$conf, $runtime; function_exists('chdir') AND chdir(APP_PATH); $r = 'mysql' == $conf['cache']['type'] ? website_set('runtime', $runtime) : cache_set('runtime', $runtime); } function runtime_truncate() { global $conf; 'mysql' == $conf['cache']['type'] ? website_set('runtime', '') : cache_delete('runtime'); } register_shutdown_function('runtime_save'); ?>theme customizer - How to Get WP_Customize_Image_Control content?|Programmer puzzle solving
最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

theme customizer - How to Get WP_Customize_Image_Control content?

matteradmin8PV0评论

I want to get WP_Customize_Manager controls from my frontend with ajax. This is possible? I looking for a solution on the internet, but I have not found so far any useful documentation about this...

I hope here is a way to get the controls LIKE this (the example not working...):

function ajax_control() {
    echo WP_Customize_Manager::get_control( 'blog_header' )->get_content;
}

I have experience in PHP OOP (even if this unclear based on my question ...), so if you just can write for me some keywords in this subject (Get Customize Controls outside of wp-admin/customize.php), please help!

Additional: Based on the above example, I adding the control (blog_header) like this:

$wp_customize->add_setting(
    'blog_header',
    array(
        'type' => 'theme_mod',
        'capability' => 'edit_theme_options',
    )
);
$wp_customize->add_control(
    new WP_Customize_Image_Control( $wp_customize, 'blog_header' )
);

And I can callback the mod with get_theme_mod( 'blog_header'), so I just interested about the CALLBACK OF THE CONTROLS FROM THE FRONTEND.

Post a comment

comment list (0)

  1. No comments so far