Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Index: widgets/pages-widget.php
- IDEA additional info:
- Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
- <+>UTF-8
- ===================================================================
- --- widgets/pages-widget.php (revision 2285717)
- +++ widgets/pages-widget.php (date 1587213595964)
- @@ -37,6 +37,9 @@
- if(isset($currentInstance['titleEnable']) == false){
- $currentInstance['titleEnable'] = 'true';
- }
- + if(isset($currentInstance['titleCustom']) == false){
- + $currentInstance['titleCustom'] = '';
- + }
- if(isset($currentInstance['customCssClass']) == false){
- $currentInstance['customCssClass'] = '';
- }
- @@ -56,6 +59,7 @@
- $currentInstance['titletype'] = "h2";
- }
- ?>
- + <input type="hidden" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" value="<?php echo esc_attr($instance['title']); ?>" />
- <p style="font-style: italic;"><small><?php _e( 'Select the page here and then edit the page under the pages tab on the left.', 'pages-in-widgets' ); ?></small></p>
- <p><label for="<?php echo $this->get_field_id('pageID'); ?>"><span style="float:left; width:100%;"><?php _e( 'Page:', 'pages-in-widgets' ); ?></span>
- <select class="large-text" style="width:100%;" id="<?php echo $this->get_field_id('pageID'); ?>" name="<?php echo $this->get_field_name('pageID'); ?>">
- @@ -78,6 +82,12 @@
- <label for="<?php echo $this->get_field_id('titleEnable'); ?>-yes"><?php _e( 'Yes:', 'pages-in-widgets' ); ?> <input type="radio" value="true" name="<?php echo $this->get_field_name('titleEnable'); ?>" id="<?php echo $this->get_field_id('titleEnable'); ?>-yes" <?php if($currentInstance['titleEnable'] == 'true'){echo 'checked="checked"';} ?>/></label>
- <label for="<?php echo $this->get_field_id('titleEnable'); ?>-no"><?php _e( 'No:', 'pages-in-widgets' ); ?> <input type="radio" value="false" name="<?php echo $this->get_field_name('titleEnable'); ?>" id="<?php echo $this->get_field_id('titleEnable'); ?>-no" <?php if($currentInstance['titleEnable'] == 'false'){echo 'checked="checked"';} ?>/></label></p>
- + <p>
- + <label for="<?php echo $this->get_field_id('titleCustom'); ?>"><?php esc_html_e( 'Custom Title:', 'pages-in-widgets' ); ?></label><br/>
- + <input class="large-text" id="<?php echo $this->get_field_id('titleCustom'); ?>" name="<?php echo $this->get_field_name('titleCustom'); ?>" value="<?php echo esc_html($currentInstance['titleCustom']); ?>">
- + <em><?php esc_html_e('Leave blank for default title.', 'pages-in-widgets'); ?></em>
- + </p>
- +
- <p> <label for="<?php echo $this->get_field_id('titletype'); ?>"><?php _e( 'Title Type:', 'pages-in-widgets' ); ?></label><br/>
- <select class="large-text" id="<?php echo $this->get_field_id('titletype'); ?>" name="<?php echo $this->get_field_name('titletype'); ?>">
- <option value="h1" <?php if($currentInstance['titletype'] == 'h1'){echo 'selected';}?>>H1</option>
- @@ -153,6 +163,7 @@
- $instance['pageID'] = $new_instance['pageID'];
- $instance['titleEnable'] = $new_instance['titleEnable'];
- + $instance['titleCustom'] = sanitize_text_field($new_instance['titleCustom']);
- $instance['customCssClass'] = $new_instance['customCssClass'];
- $instance['outputtype'] = $new_instance['outputtype'];
- $instance['outputcontent'] = $new_instance['outputcontent'];
- @@ -196,7 +207,8 @@
- echo apply_filters('pagesinwidgets_image',get_the_post_thumbnail($pageID,$imageSize));
- }
- if($titleEnable == 'true'){
- - echo '<'.$titletype . ' class="widget-title widgettitle">' . get_the_title() .'</'.$titletype.'>';
- + $title = !empty($instance['titleCustom']) ? esc_html($instance['titleCustom']) : get_the_title();
- + echo '<'.$titletype . ' class="widget-title widgettitle">' . $title .'</'.$titletype.'>';
- }
- ?>
- <div class="<?php echo (($customCssClass)?$customCssClass:'homepage_section'); ?>">
- Index: widgets/posts-widget.php
- IDEA additional info:
- Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
- <+>UTF-8
- ===================================================================
- --- widgets/posts-widget.php (revision 2285717)
- +++ widgets/posts-widget.php (date 1587213569874)
- @@ -10,7 +10,7 @@
- }
- class pagesinwidgets_post_section extends WP_Widget {
- -
- +
- function __construct(){
- parent::__construct(
- 'pagesinwidgets_post_section',
- @@ -37,6 +37,9 @@
- if(isset($currentInstance['titleEnable']) == false){
- $currentInstance['titleEnable'] = 'true';
- }
- + if(isset($currentInstance['titleCustom']) == false){
- + $currentInstance['titleCustom'] = '';
- + }
- if(isset($currentInstance['customCssClass']) == false){
- $currentInstance['customCssClass'] = '';
- }
- @@ -56,8 +59,9 @@
- $currentInstance['titletype'] = "h2";
- }
- ?>
- + <input type="hidden" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" value="<?php echo esc_attr($instance['title']); ?>" />
- <p style="font-style: italic;"><small><?php _e( 'Select the post here and then edit the post under the posts tab on the left.', 'pages-in-widgets' ); ?></small></p>
- - <p><label for="<?php echo $this->get_field_id('postID'); ?>"><span style="float:left; width:100%;"><?php _e( 'post:', 'pages-in-widgets' ); ?></span>
- + <p><label for="<?php echo $this->get_field_id('postID'); ?>"><span style="float:left; width:100%;"><?php _e( 'Post:', 'pages-in-widgets' ); ?></span><br>
- <select class="large-text" style="width:100%;" id="<?php echo $this->get_field_id('postID'); ?>" name="<?php echo $this->get_field_name('postID'); ?>">
- <?php
- $args = array( 'post_type' => 'post', 'post_status' => array('publish', 'private'), 'posts_per_post' => -1 );
- @@ -78,6 +82,12 @@
- <label for="<?php echo $this->get_field_id('titleEnable'); ?>-yes"><?php _e( 'Yes:', 'pages-in-widgets' ); ?> <input type="radio" value="true" name="<?php echo $this->get_field_name('titleEnable'); ?>" id="<?php echo $this->get_field_id('titleEnable'); ?>-yes" <?php if($currentInstance['titleEnable'] == 'true'){echo 'checked="checked"';} ?>/></label>
- <label for="<?php echo $this->get_field_id('titleEnable'); ?>-no"><?php _e( 'No:', 'pages-in-widgets' ); ?> <input type="radio" value="false" name="<?php echo $this->get_field_name('titleEnable'); ?>" id="<?php echo $this->get_field_id('titleEnable'); ?>-no" <?php if($currentInstance['titleEnable'] == 'false'){echo 'checked="checked"';} ?>/></label></p>
- + <p>
- + <label for="<?php echo $this->get_field_id('titleCustom'); ?>"><?php esc_html_e( 'Custom Title:', 'pages-in-widgets' ); ?></label><br/>
- + <input class="large-text" id="<?php echo $this->get_field_id('titleCustom'); ?>" name="<?php echo $this->get_field_name('titleCustom'); ?>" value="<?php echo esc_html($currentInstance['titleCustom']); ?>">
- + <em><?php esc_html_e('Leave blank for default title.', 'pages-in-widgets'); ?></em>
- + </p>
- +
- <p> <label for="<?php echo $this->get_field_id('titletype'); ?>"><?php _e( 'Title Type:', 'pages-in-widgets' ); ?></label><br/>
- <select class="large-text" id="<?php echo $this->get_field_id('titletype'); ?>" name="<?php echo $this->get_field_name('titletype'); ?>">
- <option value="h1" <?php if($currentInstance['titletype'] == 'h1'){echo 'selected';}?>>H1</option>
- @@ -153,6 +163,7 @@
- $instance['postID'] = $new_instance['postID'];
- $instance['titleEnable'] = $new_instance['titleEnable'];
- + $instance['titleCustom'] = sanitize_text_field($new_instance['titleCustom']);
- $instance['customCssClass'] = $new_instance['customCssClass'];
- $instance['outputtype'] = $new_instance['outputtype'];
- $instance['outputcontent'] = $new_instance['outputcontent'];
- @@ -198,7 +209,8 @@
- echo apply_filters('postsinwidgets_image',get_the_post_thumbnail($postID,$imageSize));
- }
- if($titleEnable == 'true'){
- - echo '<'.$titletype . ' class="widget-title widgettitle">' . get_the_title() .'</'.$titletype.'>';
- + $title = !empty($instance['titleCustom']) ? esc_html($instance['titleCustom']) : get_the_title();
- + echo '<'.$titletype . ' class="widget-title widgettitle">' . $title .'</'.$titletype.'>';
- } ?>
- <div class="<?php echo (($customCssClass)?$customCssClass:'homepost_section'); ?>">
- <?php
Advertisement
Add Comment
Please, Sign In to add comment