Plugin Directory

Changeset 2029777


Ignore:
Timestamp:
02/13/2019 10:13:56 AM (7 years ago)
Author:
pluginrox
Message:

New Version - 1.0.1

Location:
wp-directory-listing
Files:
134 added
7 edited

Legend:

Unmodified
Added
Removed
  • wp-directory-listing/trunk/includes/classes/class-functions.php

    r2028054 r2029777  
    1919        $this->init_query_vars();
    2020    }
    21 
    2221
    2322    /**
     
    440439    public function set_pages(){
    441440
    442         $this->page_myaccount = $this->get_option( 'wpdl_page_myaccount', 36 );
    443         $this->page_directory_archive = $this->get_option( 'wpdl_page_directory_archive', 2 );
     441        $this->page_myaccount = $this->get_option( 'wpdl_page_myaccount' );
     442        $this->page_directory_archive = $this->get_option( 'wpdl_page_directory_archive' );
    444443    }
    445444}
  • wp-directory-listing/trunk/includes/classes/class-hooks.php

    r2028054 r2029777  
    2323            add_action( 'init', array( $this, 'ob_start' ) );
    2424            add_action( 'wp_footer', array( $this, 'ob_end' ) );
    25             add_action( 'the_content', array( $this, 'print_notice' ), 1, 1 );
    26 
     25            add_action( 'the_content', array( $this, 'print_notice_and_content' ), 1, 1 );
     26           
    2727            add_filter( 'query_vars', array( $this , 'add_query_vars' ), 10 );
    2828            add_filter( 'the_title', array( $this, 'myaccount_page_title' ), 10, 2 );
     
    8585        global $wp_query;
    8686
    87         if ( ! is_null( $wp_query ) && ! is_admin() && is_main_query() && in_the_loop() && is_page() && get_post_type( $post ) == 'page' ) {
     87        if ( ! is_null( $wp_query ) && ! is_admin() && is_main_query() && in_the_loop() && is_page() && get_post_type( $post ) == 'page' && wpdl_is_myaccount_page() ) {
    8888            $endpoint       = wpdl_get_current_endpoint();
    8989            $endpoint_title = $this->get_endpoint_title( $endpoint );
     
    296296     */
    297297
    298     public function print_notice( $content ){
     298    public function print_notice_and_content( $content ){
    299299
    300300        ob_start();
     
    305305
    306306        printf( '</div>' );
     307
     308        if( wpdl_is_page( 'myaccount' ) ) {
     309
     310            remove_filter( 'the_content', 'wpautop' );
     311            echo do_shortcode( '[wpdl_my_account]' );
     312        }
     313
     314        if( wpdl_is_page('directory_archive' ) ) {
     315            remove_filter( 'the_content', 'wpautop' );
     316            echo do_shortcode( '[directory_archive]' );
     317        }
    307318
    308319        return ob_get_clean() . $content;
  • wp-directory-listing/trunk/includes/classes/class-wp-settings.php

    r2028029 r2029777  
    8383        foreach( $this->get_settings_fields() as $key => $setting ):
    8484       
    85             add_settings_section(
    86                 $key,isset( $setting['title'] ) ? $setting['title'] : "",
    87                 array( $this, 'wp_settings_section_callback' ),
    88                 $this->get_current_page()
    89             );
     85            add_settings_section( $key,isset( $setting['title'] ) ? $setting['title'] : "", array( $this, 'section_callback' ), $this->get_current_page() );
    9086           
    9187            foreach( $setting['options'] as $option ) :
     
    458454        endforeach;
    459455
     456
     457
    460458        return $whitelist_options;
    461459    }
     
    494492        do_action( 'wp_settings_page_' . $this->get_current_page() );
    495493
    496         settings_fields($this->get_menu_slug());
     494        settings_fields( $this->get_current_page());
    497495        do_settings_sections($this->get_current_page());
    498496
  • wp-directory-listing/trunk/includes/functions-settings.php

    r2028054 r2029777  
    1515        );
    1616
    17         $meta_generator = array(
    18             'page_nav'  => __( 'Configure Meta', TTDD ),
    19             'show_submit' => true,
     17        $options = array(
     18            'page_nav'  => __( 'Options', TTDD ),
     19            'page_settings' => array(
     20
     21                'section_pages' => array(
     22                    'title' => __('Pages', TTDD),
     23                    'options' => array(
     24                        array(
     25                            'id'        => 'wpdl_page_myaccount',
     26                            'title'     => __('My account page',TTDD),
     27                            'details'   => __('Select my account page',TTDD),
     28                            'type'      => 'select2',
     29                            'args'      => 'PAGES',
     30                        ),
     31                        array(
     32                            'id'        => 'wpdl_page_directory_archive',
     33                            'title'     => __('Directory archive page',TTDD),
     34                            'details'   => __('Select directory archive page',TTDD),
     35                            'type'      => 'select2',
     36                            'args'      => 'PAGES',
     37                        ),
     38                    ),
     39                ),
     40
     41            ),
    2042        );
    2143
     
    3052            'menu_slug'         => "wpdl",
    3153            'pages'             => array(
    32                 'meta' => $meta_generator,
     54                'wpdl_meta'      => $meta_generator,
     55                'wpdl_options'   => $options,
    3356            ),
    3457        );
     
    4770    }
    4871}
    49 add_action('wp_settings_page_meta', 'wpdl_wp_settings_page_meta');
     72add_action('wp_settings_page_wpdl_meta', 'wpdl_wp_settings_page_meta');
    5073
    5174
  • wp-directory-listing/trunk/includes/functions.php

    r2028054 r2029777  
    1010
    1111
     12
    1213/**
    1314 * Return query var value inside custom endpoints
     
    6465    function wpdl_is_page( $page_name = '' ){
    6566
    66         global $wp_query;
     67        global $wp_query, $wpdl;
    6768
    6869        $current_endpoint   = wpdl_get_current_endpoint();
    69         $query_vars         = $wp_query->query_vars;
     70        $query_vars         = $wp_query ? $wp_query->query_vars : array();
    7071        $bool_result        = false;
    7172
     
    7778                }
    7879                break;
     80
     81            case 'myaccount' :
     82                if( get_the_ID() == $wpdl->page_myaccount ) {
     83                    $bool_result = true;
     84                }
     85                break;
     86
     87            case 'directory_archive' :
     88                if( get_the_ID() == $wpdl->page_directory_archive ) {
     89                    $bool_result = true;
     90                }
     91                break;
    7992        }
    8093
  • wp-directory-listing/trunk/readme.txt

    r2028051 r2029777  
    66    Tested up to: 5.0.3
    77    Requires PHP: 5.6
    8     Stable tag: 1.0.0
     8    Stable tag: 1.0.1
    99    License: GPLv2 or later
    1010    License URI: http://www.gnu.org/licenses/gpl-2.0.html
  • wp-directory-listing/trunk/wp-directory-listing.php

    r2028051 r2029777  
    44    Plugin URI: https://pluginrox.com/plugin/wp-directory-listing/
    55    Description: Directory Listing Plugin for WordPress
    6     Version: 1.0.0
     6    Version: 1.0.1
    77    Author: PluginRox
    88    Author URI: https://pluginrox.com/
Note: See TracChangeset for help on using the changeset viewer.