Plugin Directory

Changeset 2185596


Ignore:
Timestamp:
11/04/2019 02:00:42 PM (6 years ago)
Author:
arjunthakur
Message:

Fixed hide option for custom posts

Location:
hide-page-and-post-title/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • hide-page-and-post-title/trunk/hide-page-and-post-title.php

    r2169381 r2185596  
    55Description: Hide the title on single pages and posts.
    66Author: Arjun Thakur
    7 Version: 1.3.3
     7Version: 1.4
    88License: GPLv2 or later
    99Author URI: https://profiles.wordpress.org/arjunthakur
     
    2424            add_action( 'save_post', array( $this, 'hpt_hptsave' ) );
    2525            add_action( 'delete_post', array( $this, 'hpt_hptdelete' ) );
    26             add_action( 'wp_head', array( $this, 'hpt_hptheadinsert' ), 3000 );
     26            add_action( 'wp_head', array( $this, 'hpt_hptheadinsert' ) );
    2727            add_action( 'the_title', array( $this, 'hpt_hptwraptitle' ) );
    2828            add_action( 'wp_enqueue_scripts', array( $this, 'hpt_hptloadscripts' ) );
     
    5252         }
    5353/*Function hptaddbox*/
    54         public function hpt_hptaddbox(){$posttypes = array( 'post', 'page' );
     54        public function hpt_hptaddbox(){
     55            $posttypes = array( 'post', 'page' );
     56            $args = array(
     57                       'public'   => true,
     58                       '_builtin' => false,
     59            );
     60
     61            $output = 'names';
     62            $operator = 'and';
     63
     64            $post_types = get_post_types( $args, $output, $operator );
     65
     66            foreach ( $post_types  as $post_type ) {
     67             
     68                $posttypes[] = $post_type;
     69
     70            } 
     71                       
    5572            foreach ( $posttypes as $posttype ){add_meta_box( $this->hpt_slug, 'Hide Page and Post Title', array( $this, 'build_hptbox' ), $posttype, 'side' );}
    5673        }
  • hide-page-and-post-title/trunk/readme.txt

    r2169381 r2185596  
    33Plugin Name: Hide Page And Post Title
    44Plugin URI: https://profiles.wordpress.org/arjunthakur#content-plugins/
    5 Tags: hide page title, hide post title, hide title, title hide, hide, hide entry title, page title hide, post title hide, wp title, custom post type, cpt hide.
     5Tags: hide page title, hide custom post title, hide post title, hide title, title hide, hide, hide entry title, page title hide, post title hide, wp title, custom post type, cpt hide, custom post title hide.
    66Author URI: https://profiles.wordpress.org/arjunthakur
    77Requires at least: 3.5
    8 Tested up to: 5.2.3
    9 Stable tag: 1.3.3
    10 Version: 1.3.3
     8Tested up to: 5.2.4
     9Stable tag: 1.4
     10Version: 1.4
    1111License: GPLv2 or later
    1212License URI: http://www.gnu.org/licenses/gpl-2.0.html
Note: See TracChangeset for help on using the changeset viewer.