22 posts
  • Sells items exclusively on Envato Market
  • Had an item featured in an Envato Bundle
  • Has sold $40,000+ on Envato Market
  • Has been part of the Envato Community for over 1 year
+2 more
themelovin says

Hi guys,

we’re developing a new wordpress theme; all’s ok, but when we try to add new term into our custom taxonomy we receive php notices like:

Notice: Trying to get property of non-object in /home/themelovin/dev/slurp/wp-admin/includes/class-wp-terms-list-table.php on line 235

or

Notice: Undefined property: WP_Error::$name in /home/themelovin/dev/slurp/wp-admin/includes/class-wp-terms-list-table.php on line 269

And so on…

We’re all going crazy :(

Someone can help us?

Pleeeeease ;)

Themelovin

741 posts
  • Had an item featured on Envato Market
  • Won a Most Wanted contest
  • Has been part of the Envato Community for over 5 years
  • Has sold $40,000+ on Envato Market
+4 more
Orbital_Themes says

So, what’s on line 235 and 269…?

161 posts
  • Has sold $10,000+ on Envato Market
  • Has collected 1+ items on Envato Market
  • Has been part of the Envato Community for over 2 years
  • Sells items exclusively on Envato Market
themebros says

I’m assuming you’re trying to access the value with…

$something->name

...but instead you should be accessing it with…

$something['name']
101 posts
  • Has sold $10,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Sells items exclusively on Envato Market
  • Has been part of the Envato Community for over 3 years
+1 more
Zanzad says

I’m assuming you’re trying to access the value with…
$something->name

...but instead you should be accessing it with…

$something['name']

+1

22 posts
  • Sells items exclusively on Envato Market
  • Had an item featured in an Envato Bundle
  • Has sold $40,000+ on Envato Market
  • Has been part of the Envato Community for over 1 year
+2 more
themelovin says

Hi,

here’s the line 235:

if ( current_user_can( get_taxonomy( $this->screen->taxonomy )->cap->delete_terms ) && $tag->term_id != $default_term )

and here’s line 269

$out .= '<div class="name">' . $qe_data->name . '</div>';

Thanks’ to everyone :)

22 posts
  • Sells items exclusively on Envato Market
  • Had an item featured in an Envato Bundle
  • Has sold $40,000+ on Envato Market
  • Has been part of the Envato Community for over 1 year
+2 more
themelovin says

Hi guys,

here’s our code to create custom post type “Portfolio”

function portfolio_register() { $labels = array( 'name' => _x('Portfolio', 'post type general name', 'themelovin'), 'singular_name' => _x('Portfolio item', 'post type singular name', 'themelovin'), 'add_new' => _x('Add new', 'portfolio item', 'themelovin'), 'add_new_item' => __('Add new portfolio item', 'themelovin', 'themelovin'), 'edit_item' => __('Edit portfolio item', 'themelovin'), 'new_item' => __('New portfolio item', 'themelovin'), 'view_item' => __('View portfolio item', 'themelovin'), 'search_items' => __('Search portfolio', 'themelovin'), 'not_found' => __('Nothing found', 'themelovin'), 'not_found_in_trash' => __('Nothing found in trash', 'themelovin'), 'parent_item_colon' => '' ); $args = array( 'labels' => $labels, 'public' => true, 'publicly_queryable' => true, 'show_ui' => true, 'query_var' => true, 'rewrite' => true, 'capability_type' => 'post', 'hierarchical' => false, 'menu_position' => null, 'supports' => array('title','editor','thumbnail', 'post-formats') ); register_post_type( 'portfolio' , $args ); flush_rewrite_rules(); } add_action('init', 'portfolio_register'); register_taxonomy("Skills", array("portfolio"), array("hierarchical" => true, "label" => "Skills", "singular_label" => "Skill", "rewrite" => true));

Seems that wordpress has some problems creating new terms for portfolio post type

Thanks a lot

Themelovin

22 posts
  • Sells items exclusively on Envato Market
  • Had an item featured in an Envato Bundle
  • Has sold $40,000+ on Envato Market
  • Has been part of the Envato Community for over 1 year
+2 more
themelovin says

Solved!!!

Thanks you all :)

741 posts
  • Had an item featured on Envato Market
  • Won a Most Wanted contest
  • Has been part of the Envato Community for over 5 years
  • Has sold $40,000+ on Envato Market
+4 more
Orbital_Themes says

So, what was wrong?

Btw, you do not want to flush rewrite rules on every page load. I suggest you remove that piece of code.

161 posts
  • Has sold $10,000+ on Envato Market
  • Has collected 1+ items on Envato Market
  • Has been part of the Envato Community for over 2 years
  • Sells items exclusively on Envato Market
themebros says

So, what was wrong? Btw, you do not want to flush rewrite rules on every page load. I suggest you remove that piece of code.

Good catch, i didn’t see it in the unformatted code.

flush_rewrite_rules should only be used on theme/plugin activation.

22 posts
  • Sells items exclusively on Envato Market
  • Had an item featured in an Envato Bundle
  • Has sold $40,000+ on Envato Market
  • Has been part of the Envato Community for over 1 year
+2 more
themelovin says

Hi guys,

I’ve no idea about the problem. I just write another time the code reported :O

Thanks about the advice regarding flush_rewrite_rules :)

Thanks you all

Themelovin

Helpful Information

  • Please read our community guidelines. Self promotion and discussion of piracy is not allowed.
  • Open a support ticket if you would like specific help with your account, deposits or purchases.
  • Item Support by authors is optional and may vary. Please see the Support tab on each item page.

Most of all, enjoy your time here. Thank you for being a valued Envato community member.

Post Reply

Format your entry with some basic HTML. Read the Full Details, or here is a refresher:

<strong></strong> to make things bold
<em></em> to emphasize
<ul><li> or <ol><li> to make lists
<h3> or <h4> to make headings
<pre></pre> for code blocks
<code></code> for a few words of code
<a></a> for links
<img> to paste in an image (it'll need to be hosted somewhere else though)
<blockquote></blockquote> to quote somebody

:grin: :shocked: :cry: Complete List of Smiley Codes

by
by
by
by
by
by