Wordpress Customizer

Worldpress Customizer

Use this checkbox to define new customizer panels, sections, settings, and controls. Use the Customizer to preview and change many of your website's appearance settings, from your Custom Header Image to widgets and more. Call the customizer in one of the following ways: WordPress Customizer allows you to optimize the appearance settings of your design and gives you a live preview of these changes.

<font color="#ffff00">Introduction

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.

Hint: As an option, the customize_preview_init-hook can be used to enqueue user-defined JavaScript on the customizer monitor. You can use JavaScript to make the customizer more reactive and efficient, but this is not necessary. Don't download your customizer stuff conditional with an is_admin() pass. When you only append your customize_register when is_admin(), then any panel, section, or control is not available when the customizer previews is loaded.

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.

Instead, if you want to prevent updating and increase reactivity, you can change it to "postMessage" and then edit all style changes by hand with some JavaScript (see Configuring Live Preview below). Section are groups of items. Defining new control means adding them to a section.

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").

Doing so disables the auto-update feature when you modify this preference so that you can set any user-defined JavaScript processing. GetMessage('blogname' )->transport ='postMessage' ; $wp_customize->get_setting('blogdescription' )->transport ='postMessage' ; $wp_customize->get_setting('header_text color' )->transport ='postMessage' ; Next, you will need to generate a new JavaScript script for all your user-defined operations.

After all, you just need to make sure that your JavaScript is queued. In order to make sure that the files are only downloaded on the administration screens of the Topic Customizer (and not on your web site), you should use the check mark customize_preview_init. Used by hook:'customize_preview_init' true//Put script in footer? 4. This example shows a possible example of implementing a fundamental themes customization class that can be integrated readily into any design.

Even this example uses the mailMessage transportation technique for previewing lives of JavaScript-based themes customizers. Contains ways to customize the design adjustment display. Customize themes by adding new custom section and control elements to the themescreen. <font color="#c400c4">(newscaster) Yeah. Javascript. Save new WP data base configuration data..... Specific privileges for access to this 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')) ;

Auch interessant

Mehr zum Thema