Quantcast
Channel: Topic Tag: plugin | WordPress.org
Viewing all articles
Browse latest Browse all 26892

curt2008 on "Add nextpage tag dynamically using Plugin Shortcode"

$
0
0

Would you mind just providing an example of using the loop_start action please?

I've tried the following to no avail:

public function __construct() {
    add_shortcode('CONTINUED', array(&$this, 'replaceShortcode'));
    add_action('loop_start', array(&$this, 'replaceShortcode'));
}

public function replaceShortcode() {
    global $post;

    if(is_user_logged_in()) {
        return str_replace('[CONTINUED]', '<div>In page 1</div><!--nextpage--><div>In page 2</div>', $post->post_content);
     }
}

Viewing all articles
Browse latest Browse all 26892

Trending Articles