Wordpress CustomizerWorldpress Customizer
4, allows designers to adjust the administrator appearancescreen ? "Customize" and insert control elements. Subject Customization" screens (e.g. "Theme Customizer") allow website administrators to optimize the website's preferences, colour schemes or topic widgets and see a real-time previewer of these changes. On this page you will find the topic Customizing API (Application Programming Interface) and how to use it in your own topics.
Regardless of whether you are a topic or a plug-in designer, you can use this interface to provide your topic or plug-in with more advanced, hands-on fitting capabilities. In order to customize the customizer with your own choices, you must use at least 2 hooks: customize_register This check enables you to create new customizer panel, section, settings and control. wp_head This check enables you to create customized style sheets so that your changes are displayed properly on the web site.
1, there are context-related panes, section, and control elements so that they can only be viewed on specific previewable Web sites. When you only record your panel, section and control when is_admin(), then you will actually say that they are not context sensitive to a given web site address. Define settings, checks, etc.
You must specify any new Customizing options, section, or control of the customizer within a customize_register operation. Initially specify the operation as follows: add_action('customize_register','mytheme_customize_register'); be aware that the $wp_customize item is transferred routinely to the feature and any adjustments you make on the Customize themes page are made using the customize $wp_customize item's theories.
Next you need to set your preferences, then your section, then your controls set (controls need a section and a preference set to work). In order to apply a new preference to your customizer, you must call the $wp_customize->add_setting() command. Specifying your preference in this way does not require you to do any additional work to make, store, or retrieve your design preferences.
The addition of a themes preference (within the customize_register action) could look like this: Standard' '#00000000', < 'refresh', ) ); Note: The key'transport' is optionally and by default set to 'refresh'. Retaining the factory preset will cause the Design Customizer previewer pane to be updated by fully refreshing itself when this preset is made.
While you can append control to standard section, we will briefly discuss appending a new section. In order to create a new section for your customizer, you must call the $wp_customize->add_section() command. The addition of a subject area (within the customize_register action) could look like this: To use one of the available built-in ones, you do not need to define it with add_section().
An HTML forms item rendered on the Topic Customizer page enables administrators to modify a preference, and view these changes in previews in near-real-time. Operating elements are associated with a unique setup and section. In order to create a new custom container for your themed customizer, you must call the function $wp_customize->add_control().
The addition of a constraint to a topic (within the customize_register action) could look like this: Labels' __('Header Color', 'mytheme' ), 'section' 'your_section_id', 'settings' 'your_setting_id', ) ) ) ) For example, suppose you have a preference named 'header_color' and it looks like this:
Standard' '#00000000', < 'postMessage' (see above "Adding a new preference").
Shipment' =>'postMessage', //What causes the update of the configuration? "Update" or "PostMessage" (immediately)? Eventually we create the actual content of the HTML container (which connects a preference to a section and render the HTML controls)..... You can also modify the built-in options by changing the property. As an example, let us use some things with the JS Life preview.......
wp_head' * * This prints the script needed to automatize the previews of the active options.
If the printout should be printed directly on the page (default: true). %s; }', × × × × × × × × × × × × × × × × × × × × × × × × × × × × × × × × × × × × × × × × × × × × × × × × × × × × × × × × × × × × × × × × × × × × × × × × × × × × × × × × × × ×.
add_action('customize_register', array('MyTheme_Customize','register')) ) ) ; add_action('wp_head', array('MyTheme_Customize','header_output')))) ; add_action('customize_preview_init', array('MyTheme_Customize','live_preview')) ;