Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: customize_sanitize_{$this->id}

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

This hook occurs 3 times in this file.

Line Code
283
284           /**
285            * Filter a Customize setting value in un-slashed form.
286            *
287            * @since 3.4.0
288            *
289            * @param mixed                $value Value of the setting.
290            * @param WP_Customize_Setting $this  WP_Customize_Setting instance.
291            */
292           return apply_filters( "customize_sanitize_{$this->id}", $value, $this );
293      }
294
295      /**
296       * Save the value of the setting, using the related API.
297       *
298       * @since 3.4.0
299       *
300       * @param mixed $value The value to update.
301       * @return mixed The result of saving the value.
 
Line Code
1231                $menu_item_value[ $key ] = sanitize_text_field( $menu_item_value[ $key ] );
1232           }
1233
1234           $menu_item_value['url'] = esc_url_raw( $menu_item_value['url'] );
1235           if ( ! get_post_status_object( $menu_item_value['status'] ) ) {
1236                $menu_item_value['status'] = 'publish';
1237           }
1238
1239           /** This filter is documented in wp-includes/class-wp-customize-setting.php */
1240           return apply_filters( "customize_sanitize_{$this->id}", $menu_item_value, $this );
1241      }
1242
1243      /**
1244       * Create/update the nav_menu_item post for this setting.
1245       *
1246       * Any created menu items will have their assigned post IDs exported to the client
1247       * via the customize_save_response filter. Likewise, any errors will be exported
1248       * to the client via the customize_save_response() filter.
1249       *
 
Line Code
1832           $value['description'] = sanitize_text_field( $value['description'] );
1833           $value['parent']      = max( 0, intval( $value['parent'] ) );
1834           $value['auto_add']    = ! empty( $value['auto_add'] );
1835
1836           if ( '' === $value['name'] ) {
1837                $value['name'] = _x( '(unnamed)', 'Missing menu name.' );
1838           }
1839
1840           /** This filter is documented in wp-includes/class-wp-customize-setting.php */
1841           return apply_filters( "customize_sanitize_{$this->id}", $value, $this );
1842      }
1843
1844      /**
1845       * Storage for data to be sent back to client in customize_save_response filter.
1846       *
1847       * @access protected
1848       * @since 4.3.0
1849       * @var array
1850       *