You’re right, that doesn’t work… yet. We didn’t add support for the dropdown-pages
control in #30738 because we wanted to leverage the REST API for this control to fetch the pages. So in 4.9 this is the only base control that requires server-side rendering in core. However, in 4.9 it is easy to provide our own implementation of a content template for the dropdown-pages
control.
I’ve written a standalone example plugin which includes control template for the dropdown-pages
control type. With that template included, you can create controls in the same way you are doing here. Follow #42272 for upcoming core implementation.
Alternatively, you may want to consider the Customize Object Selector plugin, as it provides a control which uses Select2 to provide a searchable interface for selecting one or more pages. See example usage in the Customize Posts plugin.
Related Posts:
- Is it Possible to Extend WP Customize JS Methods?
- Customizer JS API: Defining control settings
- Customizer JS API: Adding Setting Dynamically Not Working
- WordPress customizer get control
- Get a default value of the Customizer setting using wp.customize API (JS)
- Customizer JS API: Defining active_callback for a section
- Show sections based on a control in WordPress Customizer using JS API
- How do I add a class to Customizer preview based on class of Customizer control? (Customizer Javascript API)
- Get a default customizeAction text for a section using Customizer JS API
- Youtube api – stop video
- TypeError: res.status is not a function
- WP Rest API – How to get featured image
- Customizer JS API
- wp.customize.bind ready event not fired
- Show only images and videos in a wp.media window
- WordPress Rest API
- Is it possible to enqueue the Youtube API script or does it have to be inline?
- Detecting WordPress Customizer Panel
- WP Customizer set a value via javascript (to create presets)
- wp_customize_support_script – do I need it?
- Customizer – instantiating settings and controls via javascript
- Headless WordPress: How to authenticate front end requests?
- Customizer: When to use customize_preview_init VS customize_controls_enqueue_scripts
- Is there a client side API for handling transients or options?
- How to overwrite JS variable with wp_localize _script?
- Theme Customiser not live previewing changes on pseudo elements
- Hide/show customizer controls based on other settings in Customizer
- the Customizer – proper way to instantiate an image upload control via javascript
- Preserve Javascript Through Customizer Preview Navigation
- How to check if customize previewer is refreshing?
- JavaScript in WordPress Customizer
- Accessing customizer values in javascript
- Running JS after theme customizer finished initialization
- customize_preview_init: listening for any changes from Customizer preview area
- How to disable inline css styles generated by Gutenberg editor?
- How to conditionally show/hide controls & sections in WordPress customizer?
- Multiple Conditional Controllers
- Using webpack to add customizer live preview functionality – wp.customize is not a function
- Adding and removing hidden buttons from WordPress Customizer Tinymce widget editor using javascript API
- How to add customizer control via javascript ( wp.customizer.control.add )
- Load page in customizer preview on panel click?
- I am trying to add current logged in user to my zoho chat
- This page can’t load Google Maps correctly [closed]
- Adding Code into Theme Customizer Header
- Custom JS text area in customizer is being formatted wrong in document
- customize-controls.js – extend api.previewer
- how to use nimble-API and Display data?
- create timestamp links to jump to specific times on rumble videos
- Multiple jQuery inputs or binds in Customizer Control Javascripts
- WordPress Guternberg Content For React Native
- I would like to retrive JSON value and display it in wordpress page or widget
- LayersWP Customizer White Blank Screen
- Create new product with woocommerce REST API with javascript (clientside)?
- Receive “menu-toogle” event from section menu in customizer
- Anyway to disable the auto excerpt creation?
- How to get all place details from a Place Details Request using Google Places API Web Service?
- How do I check whether a checkbox is checked in jQuery?
- SyntaxError: Unexpected token o in JSON at position 1
- Heroku: “No default language could be detected for this app” error thrown for node app
- Loop inside React JSX
- Can’t resolve module (not found) in React.js
- Setting a backgroundImage With React Inline Styles
- Filter array to have unique values
- Unable to preventDefault inside passive event listener
- JavaScript variable assignments from tuples
- jQuery $.cookie is not a function
- What does “export default” do in JSX?
- Cannot find module ‘internal/fs’ after upgrading to node 7
- How can I select an element by name with jQuery?
- Uncaught TypeError: Cannot read property ‘appendChild’ of null
- javascript setTimeout() not working
- JQuery issue “TypeError: $.getJSON is not a function”
- command not found: jest
- How to access Session variables and set them in javascript?
- Google Maps JS API v3 – Simple Multiple Marker Example
- HTML onchange (this.value)
- What is the difference D3 datum vs. data?
- How to check if a number is between two values?
- Using Angular 2 without TypeScript Transpiler
- How to intercept already localized scripts
- How to get the ToggleControl Gutenberg component working for a PHP Block
- How to append a URL parameter to all outbound URLs
- Javascript Helpers
- Rest API invalid nonce with Backbone Client
- is_page not working when loading javascript with add_action in functions.php
- Hide reply button after moveForm is called
- How to add custom javascript into from custom plugin
- remove inline scripts from the_content() produced by plugins?
- How to set callback to execute after all the tinyMCE editors have been initialized?
- Correctly enqueue scripts of type=text/paperscript (PaperJs Library)
- useSelect second parameter
- How do I make my wordpress post appear in a mouse hover preview?
- Do I just put the html in a page when enqueueng or do I also have to reference js file from the html page [closed]
- jQuery UI Tools: Scrollable: More than 1 instance possible?
- VisualComposer/WPBakery Page Editor: Is any JS event triggered after the Edition pop-in is shown?
- Post title and url not showing on google map marker [closed]
- Including js script at end of header
- How would I remove an inline googleAPI font script in the the parent theme header.php?
- Trigger a function during onload
- Google AdSense Ad not showing up in WordPress Blog [closed]