Part of Slepp's ProjectsPastebinTURLImagebinFilebin
Feedback -- English French German Japanese
Create Upload Newest Tools Donate
Sign In | Create Account

Advertising

Paste Description for remove php notice from code

GIT patch (diff) with changes to code to remove PHP NOTICE error messages in log

remove php notice from code
Wednesday, July 18th, 2012 at 5:01:10am MDT 

  1. diff --git a/public_html/wp-content/plugins/wp-page-widget/wp-page-widgets.php b/public_html/wp-content/plugins/wp-page-widget/wp-page-widgets.php
  2. index 7858890..9764632 100644
  3. --- a/public_html/wp-content/plugins/wp-page-widget/wp-page-widgets.php
  4. +++ b/public_html/wp-content/plugins/wp-page-widget/wp-page-widgets.php
  5. @@ -258,7 +258,7 @@ function pw_search_page() {
  6.          </div>
  7.  
  8.          
  9.  
  10.          <div style="padding: 5px;">
  11.  
  12. -        <!--   <a id="pw-button-customize" class="<?php echo $pw_class ?>" href="#"><span class="customize">Customize</span><span class="default">Default</span></a>-->
  13.  
  14. +        <!--   <a id="pw-button-customize" class="<?php //echo $pw_class ?>" href="#"><span class="customize">Customize</span><span class="default">Default</span></a>-->
  15.  
  16.            <input type="radio" class="pw-toggle-customize" name="pw-customize-sidebars" value="no" <?php checked($customize, 'no') ?> /> Default (follow <a href="<?php echo admin_url('widgets.php') ?>">Widgets settings</a>)
  17.  
  18.            &nbsp;&nbsp;&nbsp;<input class="pw-toggle-customize" type="radio" name="pw-customize-sidebars" value="yes" <?php checked($customize, 'yes') ?> /> Customize
  19.  
  20.            <br class="clear" />
  21.  
  22. @@ -418,7 +418,7 @@ function pw_metabox_content($post) {
  23.  </div>
  24.  
  25.  
  26.  
  27.  <div style="padding: 5px;">
  28.  
  29. -<!--   <a id="pw-button-customize" class="<?php echo $pw_class ?>" href="#"><span class="customize">Customize</span><span class="default">Default</span></a>-->
  30.  
  31. +<!--   <a id="pw-button-customize" class="<?php //echo $pw_class ?>" href="#"><span class="customize">Customize</span><span class="default">Default</span></a>-->
  32.  
  33.         <input type="radio" class="pw-toggle-customize" name="pw-customize-sidebars" value="no" <?php checked($customize, 'no') ?> /> Default (follow <a href="<?php echo admin_url('widgets.php') ?>">Widgets settings</a>)
  34.  
  35.         &nbsp;&nbsp;&nbsp;<input class="pw-toggle-customize" type="radio" name="pw-customize-sidebars" value="yes" <?php checked($customize, 'yes') ?> /> Customize
  36.  
  37.         <br class="clear" />
  38.  
  39. @@ -535,7 +535,7 @@ function pw_showTaxonomyWidget($tag, $taxonomy){
  40.                </div>
  41.  
  42.                
  43.  
  44.                <div style="padding: 5px;">
  45.  
  46. -              <!--   <a id="pw-button-customize" class="<?php echo $pw_class ?>" href="#"><span class="customize">Customize</span><span class="default">Default</span></a>-->
  47.  
  48. +              <!--   <a id="pw-button-customize" class="<?php //echo $pw_class ?>" href="#"><span class="customize">Customize</span><span class="default">Default</span></a>-->
  49.  
  50.                       <input type="radio" class="pw-toggle-customize" name="pw-customize-sidebars" value="no" <?php checked($customize, 'no') ?> /> Default (follow <a href="<?php echo admin_url('widgets.php') ?>">Widgets settings</a>)
  51.  
  52.                       &nbsp;&nbsp;&nbsp;<input class="pw-toggle-customize" type="radio" name="pw-customize-sidebars" value="yes" <?php checked($customize, 'yes') ?> /> Customize
  53.  
  54.                       <br class="clear" />
  55.  
  56. @@ -655,7 +655,7 @@ function pw_returnTaxonomyWidget(){
  57.                </div>
  58.  
  59.                
  60.  
  61.                <div style="padding: 5px;">
  62.  
  63. -              <!--   <a id="pw-button-customize" class="<?php echo $pw_class ?>" href="#"><span class="customize">Customize</span><span class="default">Default</span></a>-->
  64.  
  65. +              <!--   <a id="pw-button-customize" class="<?php //echo $pw_class ?>" href="#"><span class="customize">Customize</span><span class="default">Default</span></a>-->
  66.  
  67.                       <input type="radio" class="pw-toggle-customize" name="pw-customize-sidebars" value="no" <?php checked($customize, 'no') ?> /> Default (follow <a href="<?php echo admin_url('widgets.php') ?>">Widgets settings</a>)
  68.  
  69.                       &nbsp;&nbsp;&nbsp;<input class="pw-toggle-customize" type="radio" name="pw-customize-sidebars" value="yes" <?php checked($customize, 'yes') ?> /> Customize
  70.  
  71.                       <br class="clear" />
  72.  
  73. @@ -828,11 +828,11 @@ function pw_ajax_widgets_order() {
  74.                die('-1');
  75.  
  76.         }           
  77.  
  78.  
  79.  
  80. -       $post_id = stripslashes($_POST['post_id']);
  81.  
  82. -       $tag_id = stripslashes($_POST['tag_id']);
  83.  
  84. -       $taxonomy = stripslashes($_POST['taxonomy']);
  85.  
  86. +       $post_id = isset($_POST['post_id']) ? stripslashes($_POST['post_id']) : null;
  87.  
  88. +       $tag_id = isset($_POST['tag_id']) ? stripslashes($_POST['tag_id']) : null;
  89.  
  90. +       $taxonomy = isset($_POST['taxonomy']) ? stripslashes($_POST['taxonomy']) : null;
  91.  
  92.         
  93.  
  94. -       $search_page = stripslashes($_POST['search_page']);
  95.  
  96. +       $search_page = isset($_POST['search_page']) ? stripslashes($_POST['search_page']) : null;
  97.  
  98.  
  99.  
  100.         unset( $_POST['savewidgets'], $_POST['action'] );
  101.  
  102.  
  103.  
  104. @@ -878,12 +878,12 @@ function pw_ajax_save_widget() {
  105.         if ( !$_POST['post_id'] && !$_POST['tag_id'] && !$_POST['search_page'] )
  106.  
  107.                die('-1');
  108.  
  109.  
  110.  
  111. -       $post_id = stripslashes($_POST['post_id']);
  112.  
  113. -       $tag_id = stripslashes($_POST['tag_id']);
  114.  
  115. -       $taxonomy = stripslashes($_POST['taxonomy']);
  116.  
  117. +       $post_id = isset($_POST['post_id']) ? stripslashes($_POST['post_id']) : null;
  118.  
  119. +       $tag_id = isset($_POST['tag_id']) ? stripslashes($_POST['tag_id']) : null;
  120.  
  121. +       $taxonomy = isset($_POST['taxonomy']) ? stripslashes($_POST['taxonomy']) : null;
  122.  
  123.         
  124.  
  125.         // For search page
  126.  
  127. -       $search_page = stripslashes($_POST['search_page']);
  128.  
  129. +       $search_page = isset($_POST['search_page']) ? stripslashes($_POST['search_page']) : null;
  130.  
  131.         
  132.  
  133.         unset( $_POST['savewidgets'], $_POST['action'] );
  134.  
  135.  
  136.  
  137. @@ -921,7 +921,7 @@ function pw_ajax_save_widget() {
  138.         
  139.  
  140.         
  141.  
  142.         // Save widgets
  143.  
  144. -       if ( !isset($_POST['delete_widget']) && !$_POST['delete_widget'] ) {
  145.  
  146. +       if ( !isset($_POST['delete_widget']) || !$_POST['delete_widget'] ) {
  147.  
  148.                foreach ( (array) $wp_registered_widget_updates as $name => $control ) {
  149.  
  150.  
  151.  
  152.                       if ( $name == $id_base ) {
  153.  
  154. @@ -975,7 +975,7 @@ function pw_ajax_save_widget() {
  155.         if ( !empty($_POST['add_new']) )
  156.  
  157.                die();
  158.  
  159.  
  160.  
  161. -       if ( $form = $wp_registered_widget_controls[$widget_id] )
  162.  
  163. +       if ( isset($wp_registered_widget_controls[$widget_id]) && $form = $wp_registered_widget_controls[$widget_id] )
  164.  
  165.                call_user_func_array( $form['callback'], $form['params'] );
  166.  
  167.         print 'Updated ajax save widget.';
  168.  
  169.         die();
  170.  
  171. @@ -1012,7 +1012,7 @@ function pw_filter_widgets($sidebars_widgets) {
  172.         if (
  173.  
  174.                       ( is_admin()
  175.  
  176.                              && !in_array($pagenow, array('post-new.php', 'post.php', 'edit-tags.php'))
  177.  
  178. -                            && ( !in_array($pagenow, array('admin.php')) && (($_GET['page'] == 'pw-front-page') || ($_GET['page'] == 'pw-search-page')) )
  179.  
  180. +                            && ( !in_array($pagenow, array('admin.php')) && isset($_GET['page']) && (($_GET['page'] == 'pw-front-page') || ($_GET['page'] == 'pw-search-page')) )
  181.  
  182.                       )
  183.  
  184.                       
  185.  
  186.                || (!is_admin() && !is_singular() && !is_search() && empty($objTaxonomy['taxonomy']))
  187.  
  188. @@ -1023,14 +1023,14 @@ function pw_filter_widgets($sidebars_widgets) {
  189.         
  190.  
  191.         
  192.  
  193.         // Search page
  194.  
  195. -       if ( is_search() || (is_admin() && $_GET['page'] == 'pw-search-page') ) {
  196.  
  197. +       if ( is_search() || (is_admin() && isset($_GET['page']) && $_GET['page'] == 'pw-search-page') ) {
  198.  
  199.                $enable_customize = get_option('_pw_search_page', true);
  200.  
  201.                $_sidebars_widgets = get_option('_search_page_sidebars_widgets', true);               
  202.  
  203.         }
  204.  
  205.         
  206.  
  207.  
  208.  
  209.         // Post page
  210.  
  211. -       elseif(empty($objTaxonomy['taxonomy'])){
  212.  
  213. +       elseif(empty($objTaxonomy['taxonomy']) && is_object($post)){
  214.  
  215.                $enable_customize = get_post_meta($post->ID, '_customize_sidebars', true);
  216.  
  217.                $_sidebars_widgets = get_post_meta($post->ID, '_sidebars_widgets', true);
  218.  
  219.         }

Paste Details

advertising

Update the Post

Either update this post and resubmit it with changes, or make a new post.

You may also comment on this post.

update paste below
details of the post (optional)

Note: Only the paste content is required, though the following information can be useful to others.

Save name / title?

(space separated, optional)



Please note that information posted here will expire by default in one month. If you do not want it to expire, please set the expiry time above. If it is set to expire, web search engines will not be allowed to index it prior to it expiring. Items that are not marked to expire will be indexable by search engines. Be careful with your passwords. All illegal activities will be reported and any information will be handed over to the authorities, so be good.

worth-right worth-right