Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting a notice message when I go to Manage Post types. #164

Closed
Tburkenpas opened this issue May 7, 2014 · 8 comments
Closed

Getting a notice message when I go to Manage Post types. #164

Tburkenpas opened this issue May 7, 2014 · 8 comments
Assignees

Comments

@Tburkenpas
Copy link

"Notice: Undefined property: stdClass::$publish in /Applications/MAMP/htdocs/allisongrayce.com/wp-content/plugins/custom-post-type-ui/custom-post-type-ui.php on line 648"

WordPress: 3.9

Plugin: 0.8.2

@tw2113
Copy link
Member

tw2113 commented May 7, 2014

Hmm

Line 635:
$cpt_counts = wp_count_posts($cpt_post_type["name"])

Line 648:
<td valign="top"><?php echo $cpt_counts->publish; ?></td>

Just a fyi post. It's nothing that will break the site, and will likely go away once a post is published. I think I'm ditching the table view like that in what will be 0.9, but I am not finished with it and it needs a lot of testing yet.

I'll leave the issue open as a reminder to myself though, just in case.

@Tburkenpas
Copy link
Author

Well Im working on a custom theme. And I have a temple page work.php that links to single-work.php. Though when I click on the link it get a error message "This webpage has a redirect loop". But when I turn off the plugin the webpage works. Not 100% sure that its the plugin doing this.

also the lines that the NOTICE is warning me about are

 <td valign="top"><?php echo $cpt_counts->publish; ?></td>

 <td valign="top"><?php echo $cpt_counts->draft; ?></td>

@tw2113
Copy link
Member

tw2113 commented May 7, 2014

for the redirect part, try flushing your permalinks. That may help clear it up a bit.

Not sure why wp_count_posts() is giving you fits. If it's frontend showing i can whip up a quick example of how you could eliminate the notices. If it's backend, I wouldn't worry too much about it. Also they should hide completely once you disable wp_debug.

@Tburkenpas
Copy link
Author

I have literally have tried everything to get rid of the redirect loop. I was hoping this would be the problem.

In the Manage Post types page the notice for "Total publishing" is:

Notice: Undefined property: stdClass::$publish in /Applications/MAMP/htdocs/allisongrayce.com/wp-content/plugins/custom-post-type-ui/custom-post-type-ui.php on line 648

and the notice for "Total Drafts" is:

Notice: Undefined property: stdClass::$draft in /Applications/MAMP/htdocs/allisongrayce.com/wp-content/plugins/custom-post-type-ui/custom-post-type-ui.php on line 649

@tw2113
Copy link
Member

tw2113 commented May 7, 2014

Change the lines to these:

 <td valign="top"><?php echo ( isset( $cpt_counts->publish ) ) ? $cpt_counts->publish : '0'; ?></td>

 <td valign="top"><?php echo ( isset( $cpt_counts->draft ) ) ? $cpt_counts->draft : '0'; ?></td>

It'll display 0 when the properties aren't set to anything.

@Tburkenpas
Copy link
Author

They are displaying 0

@tw2113
Copy link
Member

tw2113 commented May 7, 2014

And once you get some published posts, it should start showing the number of posts. The notice should be gone from now on for you. ;)

@Tburkenpas
Copy link
Author

Yeah the notice are gone! Thanks for the quick replay. I sincerely appreciate it.

@tw2113 tw2113 self-assigned this Jan 3, 2015
@tw2113 tw2113 closed this as completed Jan 13, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants