You should be able to do something like this:
$wp_customize = new \WP_Customize_Manager();
…since, as I understand it, WordPress core puts all its classes, functions, etc. in the global namespace.
Edit
It appears that $wp_customize
may be a bad example, as it’s a global variable (so, in your theme, all you should need to do is declare global $wp_customize;
before you use it).
If you’re looking to learn about how to use the Customize API, I’d recommend you read through the official Customize API documentation. Note that, anywhere you need to call a WordPress class or function, you can do so by prepending a \
to its name.
Related Posts:
- How can I save a multiple select array with the settings API for a plug-in options page?
- add_action in namespace not working
- Autoloading in Child Theme
- How can one utilize a variable as a callback function name for add_settings_field
- How to get bool with `get_option()` when already registered setting with type `boolean`
- Why can’t I use “%s” format value in the WordPress function checked?
- Settings API – sanitize_callback is not called and it leads to an incorrect behavior
- Why use the Settings API over a new administration menu?
- Implement toggle switch for theme options in settings API
- Set the checkbox as checked by default at options page
- Fatal Error relating to sessions.php
- Connect WordPress with SharePoint [closed]
- Whitelisting items from custom options page
- Settings API callback function inserts html quotes from nowhere
- Uploading files using the Settings API
- Get URL Parameters from referer
- Saving plugin settings – ERROR: options page not found
- Get categories names as an array to use it in theme settings
- Why is a wp function used in current PHP namespace’s callback not resolved to global scope?
- how to save checkbox data for custom setting?
- register_setting & add_settings_error validation issues with multiple fields
- Reading settings in the home page precisely home.php
- wp_localize_script() and JavaScript namespaces
- Cloning add_settings_field() with jQuery
- WordPress Settings API unable to save settings
- add_action in namespace not working
- Settings API form – submit with AJAX
- Does the namespace always have to be prefixed to the function or class when referencing callbacks in WordPress, even when they are in the same file?
- Custom plugin: how do I call a PHP file if settings option is set to true?
- register_setting not save checkbox
- image on homepage disappeared due to change of permalink name
- Autoloading Classes in Plugins
- WordPress Setting API – There is no field in options.php
- Undefined index notice when using the $args parameter in add_settings_field()
- how to test for options(fields) in settings API?
- Trouble with WordPress Settings API: Form Submits When Fields Called Directly, Fails When Using Callbacks
- WordPress Custom SQL Table with UserID Filter for results
- Automatically add images to a menu
- Display Yoast meta-description `wpseo_desc` within loop of categories and fail silently if no data is set [closed]
- Get access to variable from previous pageview, excluding ajax-calls
- Permission callback to check if user has application password
- Load Posts on Click via Ajax into a DIV
- How to catch wordpress post ID when it’s published
- calling a custom field value inside functions.php
- What is the best way to define constant options for a theme?
- WordPress redirect redirecting too many times or not at all
- Can’t retrieve element with WordPress default @fetch_rss();
- set post limit at load more ajax wordpress
- I have a snippet to redirect all users to a maintenance page. How do I exclude users with admin role?
- php esc_html_e with an html link inside not working
- How to filter custom taxonomy term name, slug, and description?
- An audio player that showcase a random song from playlist every 24h [closed]
- how to prevent wordpress admin from logging in via woocommerce my-account page
- get_the_ID() in the footer returns wrong value
- Rewrite with pagination /foo/page/2/ to posts of a given category, page 2
- Trouble inputting variable into WP query
- How to get the last category name of a child category?
- Add html link in functions.php files of the theme
- How can I add a UTM tag with PHP code to pick up the post slug dynamically in the UTM?
- How do I include SVG file used as featured image?
- Use value from Ajax call in PHP function
- require_once() if a product in woocommerce contains a tag [closed]
- the_posts_pagination() not working in wpquery
- Automatic excerpt is not shown with the_excerpt() command
- Using ob_start and ob_get_clean with wordpress shortcode
- Change “No Comments” link to “My String” on Blog Post (Find Snippet in Code or use CSS, PHP Solution) [closed]
- Return product description
- How to add the sidebar to all the pages except the home page? [closed]
- Header not properly displaying on archive.php
- Custom meta box values are not getting saved for my custom post type
- Get the last 5 products from each category
- How to say if meta_value is greater than 0 in an array?
- Getting users with a specific meta data and then querying their posts?
- Why does the post_type_link hook everything twice?
- Adding a tag_ID column into Categories inside the admin dashboard?
- How to pass a variable into an add_filter() function?
- locale filter function running multiple times
- Multiple requests external data api dynamic block gutenberg
- Why does the Woocommerce grouped template prints the unpublished products?
- Woocommerce with Lazy Load php and ajax
- Adding conditional text to a PHP Shortcode Template
- How do I get the content excerpt of the recent post?
- How to check $_GET isset for a parameter and value? [closed]
- How to deal with too many $_POST variable conditions from ajax request at backend? [closed]
- Making your own custom post views count
- Save Custom CSS file in the upload folder dynamically?
- How to use two meta_compare in an array?
- How to update and save user metadata on page visits?
- Verify if a category is the child of another category
- How to remap one of the TinyMCE Advanced Editor button to open the wordpress media library?
- Simple AJAX notification when the new post is added to the database
- How to optimize update_post_meta?
- Warning: in_array() null given in PHP function
- Contact Form 7 – Replace database configured form template with a static file
- AJAX wp_insert_user WORKS but responds with “The site is not enabled”
- Why can’t I return a value from $wpdb->get var?
- How to get User Time Zone in WordPress?
- How to hook a logout funtion for specific usr role in wordpress?
- Redirection after submitting duplicate comment
- Convert code – not work