Plugin Directory

Changeset 3189196


Ignore:
Timestamp:
11/15/2024 04:50:11 AM (14 months ago)
Author:
elvezcojp
Message:

Support twentytwentyfour

Location:
elvez-hide-entry-header/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • elvez-hide-entry-header/trunk/README.txt

    r2586776 r3189196  
    44Tags: title, header, page, post
    55Requires at least: 4.0
    6 Tested up to: 5.8
     6Tested up to: 6.4
    77Stable tag: trunk
    88Requires PHP: 7.4
     
    2424* Hide a page or post entry header (include title, categories and meta informations).
    2525* Keep each titles in the case of list view (such as search result).
     26* Support theme
     27  * twentytwenty
     28  * twentytwentyfour
    2629
    2730他にも[使いやすいWordpressプラグイン](https://shop.elvez.co.jp/product-category/wordpress%e3%83%97%e3%83%a9%e3%82%b0%e3%82%a4%e3%83%b3/)をご用意しています。
     
    4649== Changelog ==
    4750
     51= 1.1.1 =
     52* Hide title wrapper div via script.
     53
     54= 1.1.0 =
     55* Support twentytwentyfour.
     56
    4857= 1.0.5 =
    4958* Update tested version.
  • elvez-hide-entry-header/trunk/elvez-hide-entry-header.php

    r2586776 r3189196  
    1010 * Plugin URI:        https://wordpress.org/plugins/elvez-hide-entry-header
    1111 * Description:       Hide entry header in singular page or post. You can display more simply your articles.
    12  * Version:           1.0.5
     12 * Version:           1.1.1
    1313 * Requires at least: 5.2
    1414 * Requires PHP:      7.2
     
    3131 * Rename this for your plugin and update it as you release new versions.
    3232 */
    33 define( 'ELVEZ_HIDE_ENTRY_HEADER_VERSION', '1.0.5' );
     33define( 'ELVEZ_HIDE_ENTRY_HEADER_VERSION', '1.1.1' );
    3434
    3535/**
  • elvez-hide-entry-header/trunk/public/class-elvez-hide-entry-header-public.php

    r2407168 r3189196  
    6262     *
    6363     * @since     1.0.4
    64      * @param   $key    string
    65      * @param   $type   string  'scripts' | 'styles'
    66      * @return  $ver    string  Version string
     64     * @param   string  $key
     65     * @param   string  $type   'scripts' | 'styles'
     66     * @return  string  $ver    Version string
    6767     */
    6868    public static function get_registered_version( $key, $type='scripts') {
     
    120120     * Register the JavaScript for the public-facing side of the site.
    121121     *
    122      * @since    1.0.0
     122     * @since   1.0.0
     123     * @since   1.1.1   Load only allow hide title
    123124     */
    124125    public function enqueue_scripts() {
    125126
    126         wp_enqueue_script( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'js/elvez-hide-entry-header-public.js', array( 'jquery' ), $this->version, false );
     127        if ( $this->is_hide_title() ) {
     128            wp_enqueue_script( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'js/elvez-hide-entry-header-public.js', array( 'jquery' ), $this->version, false );
     129        }
    127130
    128131    }
     
    131134     * Render style tags refer from options.
    132135     *
    133      * @since    1.0.0
     136     * @since   1.0.0
     137     * @since   1.1.1   Check condition by function
    134138     */
    135139    public function render_styles() {
    136         $opt_page = get_option( ELVEZ_HIDE_ENTRY_HEADER_ADMIN::OPTION_HIDE_PAGE_HEADER, 0 );
    137         $opt_post = get_option( ELVEZ_HIDE_ENTRY_HEADER_ADMIN::OPTION_HIDE_POST_HEADER, 0 );
    138140        $opt_wc_products = get_option( ELVEZ_HIDE_ENTRY_HEADER_ADMIN::OPTION_HIDE_WC_PRODUCTS_HEADER, 0 );
    139141
    140         $style = <<<EOT
     142        if ( $this->is_hide_title() ) {
     143            $style = <<<EOT
    141144            <style>
    142                 .entry-header {
     145                .entry-header,
     146                .wp-block-post-title {
    143147                    display: none;
    144148                }
    145149            </style>
    146150            EOT;
    147         if ( 1 === intval( $opt_page ) && is_page() ) {
    148             echo $style;
    149         }
    150         if ( 1 === intval( $opt_post ) && is_single() ) {
    151151            echo $style;
    152152        }
    153153
    154         $wc_style = <<<EOT
     154        if ( 1 === intval( $opt_wc_products ) && function_exists( 'is_woocommerce' ) && is_woocommerce() ) {
     155            $wc_style = <<<EOT
    155156            <style>
    156157                .woocommerce-products-header {
     
    159160            </style>
    160161            EOT;
    161         if ( 1 === intval( $opt_wc_products ) && function_exists( 'is_woocommerce' ) && is_woocommerce() ) {
    162162            echo $wc_style;
    163163        }
    164164
    165165    }
     166
     167    /**
     168     * Check Hide title
     169     *
     170     * @since    1.1.1
     171     */
     172    public function is_hide_title() {
     173        $opt_page = get_option( ELVEZ_HIDE_ENTRY_HEADER_ADMIN::OPTION_HIDE_PAGE_HEADER, 0 );
     174        $opt_post = get_option( ELVEZ_HIDE_ENTRY_HEADER_ADMIN::OPTION_HIDE_POST_HEADER, 0 );
     175
     176        if ( 1 === intval( $opt_page ) && is_page() ) {
     177            return true;
     178        }
     179        if ( 1 === intval( $opt_post ) && is_single() ) {
     180            return true;
     181        }
     182        return false;
     183    }
    166184}
  • elvez-hide-entry-header/trunk/public/js/elvez-hide-entry-header-public.js

    r2357922 r3189196  
     1(function( $ ) {
     2    'use strict';
     3    $(document).ready( function() {
     4        $(".wp-block-post-title").parent().css("display", "none");
     5    });
     6})( jQuery );
Note: See TracChangeset for help on using the changeset viewer.