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 exactly do automatic updates work?
- Is it possible to disable a function of a parent theme?
- Variables declared in header not available in other includes
- WordPress Ajax always returns a 404 error
- Displaying a variable stored in functions.php inside widget
- Custom Meta Field – Youtube embed
- Need to get specific data from array
- Use different javascript files for each page on website
- How to get all existing post types
- Setting up 2 SMTP accounts: 1 for wordpress and 1 for woocommerce
- Function set default image when image not present
- How to get the POST TITLE using the POST ID?
- Importing hard coded custom field into acf field
- Add child pages of parent to navbar PHP
- From where the header-text can be changed in WordPress custom header?
- How to put “Read more” link in Custom Excerpt inside p tag?
- $wpdb->update with multiple parameters gives error
- Improve page speed loading using CDN and async or defer attribute
- Applying A Category to Existing Posts Where Page Title Matches Regex
- Get users that likes the post
- wordpress visual composer change grid builder post link
- PHP array to JS array to use in google map
- My custom get_the_excerpt() can’t get excerpt by ID
- deactivating an active plugin using if page
- Single Quotes in .php file doesn’t load website
- What file have I to create in my custom WordPress theme to show all the post belonging to a specific category?
- Last class on last headline?
- your php installation be missing the MySQL extension WordPress CPANEL [closed]
- {$key} or $key?
- WordPress mod_rewrite not working on php fpm
- Shortcode to pull posts
- Notice: Trying to get property of non-object
- How do I pull information from one wordpress backend into another? [closed]
- Change Spaces to Dashes?
- Check if current post in loop is last on current page
- php code for outputting a custom page in my account
- Add a top bar to a wordpress theme without editing the header.php file?
- Check the database for a postmeta field
- Random code snippet showing up in browser
- Roots Sage Symfony error when using override from template
- Return author name as a tag using get_author
- How to pull date/time in french format for wordpress post?
- WooCommerce subcategories help
- What is wrong with this shortcode? to include external php file in WordPress posts
- ACF + WP + Slick Slider Repeater Slide Group PHP not Displaying [closed]
- wp_query beginner
- Crop an image after upload on custom account page
- Migrating a live WordPress website to a Local Server: why some elements of the website are missing?
- Store stripe info as user_meta
- Is there a way to have chunks of a page’s content expire?
- INCOMING: Wall of code for form and $_POST, not updating custom field’s value
- WooCommerce – Print Processing orders [closed]
- Loop returns more items than exist?
- Adding theme strings to .PO file
- Rewriting to a different page based on existence of query string?
- Host does not allow remote connection, so how do I transfer data to my WordPress site?
- I am extending Walker_Nav_Menu: How can I get the number of children elements of the current item?
- How to call a specific value within the functions.php file?
- WordPress White Screen Error
- Warning: filemtime(): stat failed for wp_
- How to transfer session after being redirected to other page
- Keep users logged in Without Remember Me
- How to use js variable to php in wordpress functions.php
- Display total count of products in orders of a specific order status
- SQL – How to echo out inside of where statement
- How to create different templates for woocommerce single-product.php?