Skip to:
Content
Pages
Categories
Search
Top
Bottom

What is wrong with my code? I got Notice – Non Object


  • jessy
    Participant

    @jessy-marco

    function oi_add_shortcodes_to_activity_stream() {
    // Shortcodes are allowed for someone who has capability of moderate_comments
    function oi_record_post_activity_content($activity_content) {
    	
    	if( user_can( bp_get_activity_user_id(), pw_bbp_parse_capability() ) )
            return do_shortcode($activity_content);
            
            return $activity_content;
    }		
    add_filter( 'bp_get_activity_content_body', 'oi_record_post_activity_content',1,3);
    add_filter( 'bp_get_activity_content', 'oi_record_post_activity_content',1,3);
    
    }
    add_action('bp_init', 'oi_add_shortcodes_to_activity_stream');

    Notice:
    Trying to get property of non-object in /opt/wordpress-4.0-0/apps/wordpress/htdocs/wp-content/plugins/buddypress/bp-activity/bp-activity-template.php on line 1186

    When I click on read more and the long text will apear – whole activity post a get notice above the my submitted content.

    Thank you.

  • The topic ‘What is wrong with my code? I got Notice – Non Object’ is closed to new replies.
Skip to toolbar