Changeset 3189196
- Timestamp:
- 11/15/2024 04:50:11 AM (14 months ago)
- Location:
- elvez-hide-entry-header/trunk
- Files:
-
- 4 edited
-
README.txt (modified) (3 diffs)
-
elvez-hide-entry-header.php (modified) (2 diffs)
-
public/class-elvez-hide-entry-header-public.php (modified) (4 diffs)
-
public/js/elvez-hide-entry-header-public.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
elvez-hide-entry-header/trunk/README.txt
r2586776 r3189196 4 4 Tags: title, header, page, post 5 5 Requires at least: 4.0 6 Tested up to: 5.86 Tested up to: 6.4 7 7 Stable tag: trunk 8 8 Requires PHP: 7.4 … … 24 24 * Hide a page or post entry header (include title, categories and meta informations). 25 25 * Keep each titles in the case of list view (such as search result). 26 * Support theme 27 * twentytwenty 28 * twentytwentyfour 26 29 27 30 他にも[使いやすいWordpressプラグイン](https://shop.elvez.co.jp/product-category/wordpress%e3%83%97%e3%83%a9%e3%82%b0%e3%82%a4%e3%83%b3/)をご用意しています。 … … 46 49 == Changelog == 47 50 51 = 1.1.1 = 52 * Hide title wrapper div via script. 53 54 = 1.1.0 = 55 * Support twentytwentyfour. 56 48 57 = 1.0.5 = 49 58 * Update tested version. -
elvez-hide-entry-header/trunk/elvez-hide-entry-header.php
r2586776 r3189196 10 10 * Plugin URI: https://wordpress.org/plugins/elvez-hide-entry-header 11 11 * Description: Hide entry header in singular page or post. You can display more simply your articles. 12 * Version: 1. 0.512 * Version: 1.1.1 13 13 * Requires at least: 5.2 14 14 * Requires PHP: 7.2 … … 31 31 * Rename this for your plugin and update it as you release new versions. 32 32 */ 33 define( 'ELVEZ_HIDE_ENTRY_HEADER_VERSION', '1. 0.5' );33 define( 'ELVEZ_HIDE_ENTRY_HEADER_VERSION', '1.1.1' ); 34 34 35 35 /** -
elvez-hide-entry-header/trunk/public/class-elvez-hide-entry-header-public.php
r2407168 r3189196 62 62 * 63 63 * @since 1.0.4 64 * @param $key string65 * @param $type string'scripts' | 'styles'66 * @return $ver stringVersion string64 * @param string $key 65 * @param string $type 'scripts' | 'styles' 66 * @return string $ver Version string 67 67 */ 68 68 public static function get_registered_version( $key, $type='scripts') { … … 120 120 * Register the JavaScript for the public-facing side of the site. 121 121 * 122 * @since 1.0.0 122 * @since 1.0.0 123 * @since 1.1.1 Load only allow hide title 123 124 */ 124 125 public function enqueue_scripts() { 125 126 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 } 127 130 128 131 } … … 131 134 * Render style tags refer from options. 132 135 * 133 * @since 1.0.0 136 * @since 1.0.0 137 * @since 1.1.1 Check condition by function 134 138 */ 135 139 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 );138 140 $opt_wc_products = get_option( ELVEZ_HIDE_ENTRY_HEADER_ADMIN::OPTION_HIDE_WC_PRODUCTS_HEADER, 0 ); 139 141 140 $style = <<<EOT 142 if ( $this->is_hide_title() ) { 143 $style = <<<EOT 141 144 <style> 142 .entry-header { 145 .entry-header, 146 .wp-block-post-title { 143 147 display: none; 144 148 } 145 149 </style> 146 150 EOT; 147 if ( 1 === intval( $opt_page ) && is_page() ) {148 echo $style;149 }150 if ( 1 === intval( $opt_post ) && is_single() ) {151 151 echo $style; 152 152 } 153 153 154 $wc_style = <<<EOT 154 if ( 1 === intval( $opt_wc_products ) && function_exists( 'is_woocommerce' ) && is_woocommerce() ) { 155 $wc_style = <<<EOT 155 156 <style> 156 157 .woocommerce-products-header { … … 159 160 </style> 160 161 EOT; 161 if ( 1 === intval( $opt_wc_products ) && function_exists( 'is_woocommerce' ) && is_woocommerce() ) {162 162 echo $wc_style; 163 163 } 164 164 165 165 } 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 } 166 184 } -
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.