Changeset 2848888
- Timestamp:
- 01/16/2023 06:20:33 AM (3 years ago)
- Location:
- customize-private-protected
- Files:
-
- 8 added
- 2 edited
-
tags/1.1.0 (added)
-
tags/1.1.0/LICENSE (added)
-
tags/1.1.0/css (added)
-
tags/1.1.0/css/custom-controls.css (added)
-
tags/1.1.0/css/style.css (added)
-
tags/1.1.0/customize-private-protected.php (added)
-
tags/1.1.0/readme.txt (added)
-
trunk/css/custom-controls.css (added)
-
trunk/customize-private-protected.php (modified) (13 diffs)
-
trunk/readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
customize-private-protected/trunk/customize-private-protected.php
r2789690 r2848888 4 4 Plugin URI: https://github.com/kclarkedesign/cpp 5 5 Description: Use WP Customize to modify elements of password protected and private posts and pages. 6 Version: 1. 0.16 Version: 1.1.0 7 7 Author: Kirk Clarke 8 8 Author URI: http://kirkclarke.com … … 23 23 { 24 24 25 26 class WP_Customize_Input_PX_Append_Control extends WP_Customize_Control { 27 public $type = 'text_input_px_append'; 28 29 public function enqueue() { 30 wp_enqueue_style( 'cpp_custom_controls_css', plugins_url('css/custom-controls.css', __FILE__)); 31 } 32 /** 33 * Render the control's content. 34 */ 35 public function render_content() { ?> 36 <?php if ( ! empty( $this->label ) ) : ?> 37 <label for="<?php echo esc_attr( $input_id ); ?>" 38 class="customize-control-title"><?php echo esc_html( $this->label ); ?></label> 39 <?php endif; ?> 40 <?php if ( ! empty( $this->description ) ) : ?> 41 <span id="<?php echo esc_attr( $description_id ); ?>" 42 class="description customize-control-description"><?php echo $this->description; ?></span> 43 <?php endif; ?> 44 <div class="cpp-customize-control input-group"> 45 <input id="<?php echo esc_attr( $input_id ); ?>" class="form-control" type="<?php echo esc_attr( $this->type ); ?>" 46 <?php echo $describedby_attr; ?> <?php $this->input_attrs(); ?> 47 <?php if ( ! isset( $this->input_attrs['value'] ) ) : ?> value="<?php echo esc_attr( $this->value() ); ?>" 48 <?php endif; ?> <?php $this->link(); ?> /> 49 <div class="input-group-append"> 50 <span class="input-group-text">px</span> 51 </div> 52 </div> 53 <?php } 54 } 55 56 25 57 $wp_customize->add_section( 26 58 'cpp_plugin_settings', 27 59 array( 28 'title' => 'Custom Private & Protected',60 'title' => __('Customize Private & Protected'), 29 61 'priority' => 20 30 62 … … 50 82 array( 51 83 'type' => 'checkbox', 52 'label' => 'Hide Prefix',84 'label' => __('Hide Prefix'), 53 85 'section' => 'cpp_plugin_settings', 54 86 'settings' => 'cpp_hide_prefix', … … 74 106 array( 75 107 'type' => 'checkbox', 76 'label' => 'Use Default form',108 'label' => __('Use Default form'), 77 109 'section' => 'cpp_plugin_settings', 78 110 'settings' => 'cpp_use_default_form', … … 85 117 86 118 $wp_customize->add_setting( 119 'cpp_prefix_private', 120 array( 121 'type' => 'option', 122 'capability' => 'manage_options', 123 'default' => 'Private: ', 124 'sanitize_callback' => 'wp_kses_post', 125 ) 126 ); 127 128 $wp_customize->add_control( 129 'cpp_prefix_private', 130 array( 131 'label' => __('Private Title Prefix'), 132 'section' => 'cpp_plugin_settings', 133 'settings' => 'cpp_prefix_private', 134 'active_callback' => 'customize_pp_plugin_hide_prefix_condition' 135 ) 136 ); 137 138 $wp_customize->add_setting( 87 139 'cpp_prefix_protected', 88 140 array( … … 97 149 'cpp_prefix_protected', 98 150 array( 99 'label' => 'Protected Title Prefix',151 'label' => __('Protected Title Prefix'), 100 152 'section' => 'cpp_plugin_settings', 101 153 'settings' => 'cpp_prefix_protected', 102 'active_callback' => 'customize_pp_plugin_hide_prefix_condition'103 )104 );105 106 $wp_customize->add_setting(107 'cpp_prefix_private',108 array(109 'type' => 'option',110 'capability' => 'manage_options',111 'default' => 'Private: ',112 'sanitize_callback' => 'wp_kses_post',113 )114 );115 116 $wp_customize->add_control(117 'cpp_prefix_private',118 array(119 'label' => 'Private Title Prefix',120 'section' => 'cpp_plugin_settings',121 'settings' => 'cpp_prefix_private',122 154 'active_callback' => 'customize_pp_plugin_hide_prefix_condition' 123 155 ) … … 142 174 array( 143 175 'type' => 'textarea', 144 'label' => 'Protected Intro Text',176 'label' => __('Protected Intro Text'), 145 177 'section' => 'cpp_plugin_settings', 146 178 'settings' => 'cpp_text_intro', … … 167 199 array( 168 200 'type' => 'textarea', 169 'label' => 'Protected Label Text',201 'label' => __('Protected Label Text'), 170 202 'section' => 'cpp_plugin_settings', 171 203 'settings' => 'cpp_label_text', … … 191 223 'cpp_button_text', 192 224 array( 193 'label' => 'Protected Button Text',225 'label' => __('Protected Button Text'), 194 226 'section' => 'cpp_plugin_settings', 195 227 'settings' => 'cpp_button_text', … … 197 229 ) 198 230 ); 231 232 // ============================= 233 // = Protected Button Appearance Panel 234 // ============================= 235 236 /** TODO: Add ability to customize button style and/or additonal button styles */ 237 238 $wp_customize->add_setting( 239 'cpp_button_x_padding', 240 array( 241 'type' => 'option', 242 'capability' => 'manage_options', 243 'default' => 20, 244 'sanitize_callback' => 'wp_kses_post', 245 ) 246 ); 247 248 $wp_customize->add_control( 249 new WP_Customize_Input_PX_Append_Control( 250 $wp_customize, 251 'cpp_button__x_padding', 252 array( 253 'label' => __( 'Protected Button Horizontal Padding' ), 254 'description' => __('Controls padding inside the button to the left and right of the button text in pixels (px). Leave blank for default'), 255 'type' => 'number', 256 'settings' => 'cpp_button_x_padding', 257 'section' => 'cpp_plugin_settings', 258 'input_attrs' => array( 259 'min' => 0, 260 ), 261 'active_callback' => 'customize_pp_plugin_hide_form_options_condition' 262 ) 263 ) 264 ); 265 266 $wp_customize->add_setting( 267 'cpp_button_y_padding', 268 array( 269 'type' => 'option', 270 'capability' => 'manage_options', 271 'default' => 10, 272 'sanitize_callback' => 'wp_kses_post', 273 ) 274 ); 275 276 $wp_customize->add_control( 277 new WP_Customize_Input_PX_Append_Control( 278 $wp_customize, 279 'cpp_button_y_padding', 280 array( 281 'label' => __( 'Protected Button Vertical Padding' ), 282 'description' => __('Controls padding inside the button above and below the button text in pixels (px). Leave blank for default'), 283 'type' => 'number', 284 'settings' => 'cpp_button_y_padding', 285 'section' => 'cpp_plugin_settings', 286 'input_attrs' => array( 287 'min' => 0, 288 ), 289 'active_callback' => 'customize_pp_plugin_hide_form_options_condition' 290 ) 291 ) 292 ); 199 293 } 200 294 201 295 add_action('customize_register', 'customize_pp_plugin_register_customizer'); 202 296 203 /** TODO: Add ability to customize button style and/or additonal button styles */ 297 204 298 205 299 /** … … 310 404 $cpp_label = get_option('cpp_label_text', 'Password: '); 311 405 $cpp_button_text = get_option('cpp_button_text', 'Enter'); 406 407 $y_padding = ('' == get_option('cpp_button_y_padding')) ? '' : get_option('cpp_button_y_padding') . 'px '; 408 $x_padding = ('' == get_option('cpp_button_x_padding')) ? '' : get_option('cpp_button_x_padding') . 'px;'; 409 $cpp_button_padding = ('' == $y_padding && '' == $x_padding) ? '' : 'padding: '. $y_padding . $x_padding .''; 410 312 411 $label_selector = 'pwbox-' . (empty($post->ID) ? rand() : $post->ID); 313 412 } … … 322 421 if (false == $cpp_use_default_form) { 323 422 $output = $before_area . '<p>' . $cpp_intro . '</p>' . '<form class="cpp-form" action="' . esc_attr(site_url('wp-login.php?action=postpass', 'login_post')) . '" class="post-password-form" method="post"> 324 ' . '<label class="cpp-label" for="' . esc_attr__($label_selector) . '">' . $cpp_label . ' </label><input class="cpp-password" name="post_password" id="' . $label_selector . '" type="password" size="20" maxlength="20" /><input class="cpp-submit" type="submit" name="Submit" value="' . esc_attr__($cpp_button_text) . '" />423 ' . '<label class="cpp-label" for="' . esc_attr__($label_selector) . '">' . $cpp_label . ' </label><input class="cpp-password" name="post_password" id="' . $label_selector . '" type="password" size="20" maxlength="20" /><input class="cpp-submit" style="'. esc_attr__($cpp_button_padding) .'" type="submit" name="Submit" value="' . esc_attr__($cpp_button_text) . '" /> 325 424 </form>' . $after_area; 326 425 } else if (function_exists('et_password_form')) { /* if divi theme */ … … 347 446 if ( in_array( 'Administrator', (array) $user->roles ) || in_array( 'Super Administrator', (array) $user->roles ) ) { 348 447 echo '<div class="notice notice-info is-dismissible"> 349 <p>Find Customize Private & Protected helpful? give it a 5-star rating on WordPress</p>448 <p>Find Customize Private & Protected helpful? Give it a 5-star rating on WordPress</p> 350 449 <p><a href="https://wordpress.org/support/plugin/customize-private-protected/reviews/#new-post" class="" target="_blank" rel="noopener noreferrer">Sure, you deserve it!</a> 351 450 </div>'; -
customize-private-protected/trunk/readme.txt
r2789689 r2848888 5 5 Tags: page title, title prefix, password protected, widget, change prefix, change, customize, private, protect, password, prefix, remove 6 6 Requires at least: 5.8 7 Tested up to: 6. 0.28 Stable tag: 1. 0.17 Tested up to: 6.1.1 8 Stable tag: 1.1.0 9 9 Requires PHP: 7.0 10 10 License: GPLv2 or later … … 50 50 == Changelog == 51 51 52 = 1.1.0 - 01-16-2023 = 53 - Tested - Passed test with WordPress version 6.1.1 54 - Feature - Added ability to customize protected button appearance 55 - Enhancement - Enabled translation in plugin labels 56 - Enhancement - Minor cleanup 57 52 58 = 1.0.1 - 09-24-2022 = 53 59 - Tested - Passed test with WordPress version 6.0.2 54 - En chancement - Added dismissible notice for plugin review60 - Enhancement - Added dismissible notice for plugin review 55 61 56 62 = 1.0.0 - 07-21-2022 = … … 62 68 = 1.0.0 - 04-06-2022 = 63 69 - Tested - Passed test with WordPress version 5.9.3 64 - En chancement - Updated default values for button and label70 - Enhancement - Updated default values for button and label 65 71 66 72 = 0.2.0 - 01-09-2022 = 67 - En chancement - Made fields hide/show based on hide Prefix & Use Default checkboxes68 - En chancement - Added support for Divi password form73 - Enhancement - Made fields hide/show based on hide Prefix & Use Default checkboxes 74 - Enhancement - Added support for Divi password form 69 75 - Feature - Added option to display Wordpress' default form with widgets 70 76
Note: See TracChangeset
for help on using the changeset viewer.