Plugin Directory

Changeset 2098227


Ignore:
Timestamp:
05/31/2019 12:47:18 AM (7 years ago)
Author:
wpgurus
Message:

v1.2.1

Location:
title-remover
Files:
3 added
2 edited

Legend:

Unmodified
Added
Removed
  • title-remover/trunk/readme.txt

    r2090863 r2098227  
    44Donate link: http://wpgurus.net/title-remover/
    55Requires at least: 2.5
    6 Tested up to: 5.2
    7 Stable tag: 1.2
     6Tested up to: 5.2.1
     7Stable tag: 1.2.1
    88License: License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    2929 
    3030== Changelog ==
    31 = 1.0 =
    32 * Initial release
     31= 1.2.1 =
     32* Made plugin strings translatable
     33* Fixed typos in code
     34
     35= 1.2 =
     36* Fixed the warnings that are displayed on some websites.
    3337
    3438= 1.1 =
     
    3640* Added new graphics for WP.org
    3741
    38 = 1.2 =
    39 * Fixed the warnings that are displayed on some websites.
     42= 1.0 =
     43* Initial release
  • title-remover/trunk/title-remover.php

    r1866904 r2098227  
    44Plugin URI: http://wpgurus.net/title-remover/
    55Description: Gives you the ability to hide the title of any post, page or custom post type item without affecting menus or titles in the admin area.
    6 Version: 1.2
     6Version: 1.2.1
    77Author: WPGurus
    88Author URI: http://wpgurus.net/
     
    1010*/
    1111
    12 /*--------------------------------------------------
    13     Hide Title
    14 ----------------------------------------------------*/
     12/**
     13 * Load plugin text domain
     14 */
     15function wptr_load_plugin_textdomain() {
     16    load_plugin_textdomain(
     17        'title-remover', false,
     18        dirname( plugin_basename( __FILE__ ) ) . '/languages'
     19    );
     20}
    1521
    16 function wptr_supress_title( $title, $post_id = 0 ) {
     22add_action( 'plugins_loaded', 'wptr_load_plugin_textdomain' );
     23
     24/**
     25 * Filter the title and return empty string if necessary.
     26 *
     27 * @param $title string The old title
     28 * @param int $post_id The post ID
     29 *
     30 * @return string Old title or empty string.
     31 */
     32function wptr_suppress_title( $title, $post_id = 0 ) {
    1733    if ( ! $post_id ) {
    1834        return $title;
     
    2743}
    2844
    29 add_filter( 'the_title', 'wptr_supress_title', 10, 2 );
     45add_filter( 'the_title', 'wptr_suppress_title', 10, 2 );
    3046
    3147/*--------------------------------------------------
     
    4662function wptr_add_post_meta_boxes() {
    4763    add_meta_box(
    48         'wptr-hide-title',        // Unique ID
    49         'Hide Title?',            // Title
    50         'wptr_render_metabox',    // Callback function
    51         null,                    // Admin page
    52         'side',                    // Context
    53         'core'                    // Priority
     64        'wptr-hide-title',
     65        esc_html__( 'Hide Title?', 'title-remover' ),
     66        'wptr_render_metabox',
     67        null,
     68        'side',
     69        'core'
    5470    );
    5571}
     
    6278    <input type="checkbox" name="wptr-hide-title-checkbox" id="wptr-hide-title-checkbox"
    6379           value="1" <?php checked( $curr_value, '1' ); ?> />
    64     <label for="wptr-hide-title-checkbox">Hide the title for this item</label>
     80    <label for="wptr-hide-title-checkbox"><?php esc_html_e( 'Hide the title for this item', 'title-remover' ); ?></label>
    6581    <?php
    6682}
Note: See TracChangeset for help on using the changeset viewer.