diff --git a/init.php b/init.php index 00a750b..14188e5 100644 --- a/init.php +++ b/init.php @@ -22,7 +22,8 @@ // Load funnel type classes. require WP_FUNNEL_DIR . 'src/legacy.php'; -require WP_FUNNEL_DIR . 'src/funnel.php'; +require WP_FUNNEL_DIR . 'src/dynamic.php'; +require WP_FUNNEL_DIR . 'src/natural.php'; // Load other classes. require WP_FUNNEL_DIR . 'src/plugin.php'; diff --git a/src/funnel.php b/src/dynamic.php similarity index 99% rename from src/funnel.php rename to src/dynamic.php index 075b509..a554674 100644 --- a/src/funnel.php +++ b/src/dynamic.php @@ -1,11 +1,11 @@ slug || isset( $this->added_wp_link_pages[ $id ] ) ) or $this->added_wp_link_pages[ $id ] = true; + return $parsed_args; + } + + public function add_wp_link_pages( $content ) + { + $id = get_the_ID(); + + if ( get_post_type() === $this->slug && $GLOBALS['multipage'] && !isset( $this->added_wp_link_pages[ $id ] ) ) + { + $this->added_wp_link_pages[ $id ] = false; + return $content . wp_link_pages( array( 'echo' => 0 ) ); + } + + return $content; + } +} diff --git a/src/plugin.php b/src/plugin.php index 12098a3..cf19825 100644 --- a/src/plugin.php +++ b/src/plugin.php @@ -113,7 +113,7 @@ public function register_funnel_types() if ( !$this->is_legacy || $slug !== 'funnel' ) { - $this->funnel_types[] = new Funnel_Type( $slug, $post->ID, $post->post_title, $post->post_content, $post->post_author ); + $this->funnel_types[] = new Natural_Funnel_Type( $slug, $post->ID, $post->post_title, $post->post_content, $post->post_author ); } } } @@ -163,7 +163,7 @@ public function menu() $parent_capability = $this->is_legacy ? 'edit_posts' : $new_type_capability; // Workaround for core ticket #52043. If the bug is encountered, the menu for one of the funnel types needs to be registered separately here. - $type = Funnel_Type::get_type_for_parent_menu(); + $type = Dynamic_Funnel_Type::get_type_for_parent_menu(); if ( !is_null( $type ) || $this->is_legacy && $this->is_templated && !current_user_can( $parent_capability ) && current_user_can( $new_type_capability ) ) {