Plugin Directory

Changeset 1746861


Ignore:
Timestamp:
10/15/2017 04:17:46 PM (8 years ago)
Author:
codingpuss
Message:

better filter for search result

Location:
wp-lead-plus-free-squeeze-pages-creator/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • wp-lead-plus-free-squeeze-pages-creator/trunk/inc/c37-page-manager.php

    r1716737 r1746861  
    2626                'rewrite'   => false,
    2727                'show_ui'   => false,
     28                'exclude_from_search' => true,
    2829                'supports'  => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt' )
    2930            )
     
    4344                'public'    => true,
    4445                'rewrite'   => false,
     46                'exclude_from_search' => true,
    4547                'show_ui'   => false,
    4648                'supports'  => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt' )
     
    6264                'public' => true,
    6365                'rewrite' => false,
     66                'exclude_from_search' => true,
    6467                'show_ui' => false,
    6568                'supports'       => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt' )
  • wp-lead-plus-free-squeeze-pages-creator/trunk/inc/c37-popup-manager.php

    r1739162 r1746861  
    2424                'has_archive' => false,
    2525                'show_ui' => false,
    26 
     26                'exclude_from_search' => true,
    2727                'supports'           => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt' )
    2828            )
  • wp-lead-plus-free-squeeze-pages-creator/trunk/inc/c37-widget-manager.php

    r1739162 r1746861  
    2424                'has_archive' => false,
    2525                'show_ui' => false,
    26 
     26                'exclude_from_search' => true,
    2727                'supports'           => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt' )
    2828            )
  • wp-lead-plus-free-squeeze-pages-creator/trunk/index.php

    r1746859 r1746861  
    55    Description: WordPress Landing pages builder, squeeze pages, lead generation pages, popup, widgets creator. Responsive pages that work perfectly on all devices.
    66    Author: core37, codingpuss, landingpagebuilderwizard
    7     Version: 1.10.56
     7    Version: 1.10.57
    88    Author URI: http://www.gatovago.com/
    99    Text Domain: wp-lead-plus-x
     
    2626if (!defined('WPLX_VERSION_CODE_FREE'))
    2727{
    28     define('WPLX_VERSION_CODE_FREE', 56);
     28    define('WPLX_VERSION_CODE_FREE', 57);
    2929}
    3030
     
    4646
    4747
    48 add_action( 'init', 'c37_remove_template_post_type', 99 );
     48function c37_remove_template_post_type($query) {
    4949
    50 function c37_remove_template_post_type() {
    51     global $wp_post_types;
     50    if ($query->is_search) {
    5251
    53     if ( post_type_exists( 'core37_lp_template' ) ) {
     52        $query->set('post_type', 'post', 'page');
    5453
    55         // exclude from search results
    56         $wp_post_types['core37_lp_template']->exclude_from_search = true;
    5754    }
     55    return $query;
     56
    5857}
     58
     59add_filter('pre_get_posts','c37_remove_template_post_type');
     60
     61//add_action( 'init', 'c37_remove_template_post_type', 99 );
     62//
     63//function c37_remove_template_post_type() {
     64//  global $wp_post_types;
     65//
     66//  if ( post_type_exists( 'core37_lp_template' ) ) {
     67//
     68//      // exclude from search results
     69//      $wp_post_types['core37_lp_template']->exclude_from_search = true;
     70//      $wp_post_types['core37_lp']->exclude_from_search = true;
     71//  }
     72//}
Note: See TracChangeset for help on using the changeset viewer.