Turns out, Divi cannot handle associative arrays, in my case with post id as key and post title as value. Using an indexed array solves the problem. Unfortunately, this is not mentioned anywhere in the documentation.
Thus I changed the code in the get_post_options() function from
foreach ($posts as $post) {
$options[$post->ID] = $post->post_title;
}
to
$index = 1;
foreach ($posts as $post) {
$options[$index] = $post->post_title;
$index++;
}
Why this is the case, I can’t answer.
Related Posts:
- WordPress different custom tag being displayed in on tag list
- Can I associate a custom post type with another custom post type?
- Remove “Insert from URL” link in Media upload – WP 3.5
- Proper use of Output Buffer
- Does My Child-Theme Functions.php Need if{die} Security In It? [duplicate]
- class=”parent” for wp_list_pages?
- if has theme mod
- Count Title and Post Characters
- Remove css styles from specific page
- How to remove this function from the homepage?
- Custom plugin issue when trying to use the shortcode twice on a page [closed]
- Check if current page is wp-admin
- HTML table from shortcode with multiple parameters
- Nested shortCode functions in the functions.php file
- Show only IF not Google bot [closed]
- How the functions in WP are called in tags
- Woocommerce – remove product from category
- Differences when using the the_time and the_date functions
- Add a Second Menu to a theme that only support 1 menu
- Custom excerpt function re-factoring
- Add itemprop Schema.org Markup to li Elements in wp_nav_menu
- Displaying the Month and Year that a page was Created?
- How to access global variable $menu inside a class function
- How to pick the default selected value in wordpress dropdown?
- Why ajax doesn’t work on certain wordpress hooks?
- Print last modified date only on posts
- WooCommerce: How can I get orders with a custom ID in order meta data object?
- Modify function to print tags/categories/exclude tags/categories/ number of posts
- Search not showing all results
- How to Reference/Echo Variable from Another PHP Function
- Detecting classes, adding widgets, and adding divs in with a Nav Walker
- Trying to retrieve post meta
- Need help enqueueing webfonts
- Add class to group inner container
- Redirect to another page using contact form 7? [closed]
- Error call_user_func_array() expects parameter 1 to be a valid callback when using image_size_names_choose
- Use .php file as page instead of wordpress page & template file?
- Find hours between post_date and post_date_gmt
- Run a code only on theme activation only during first activation
- Shortcode from a function not working
- Is it possible to return content, and then also continue to do other things?
- Creating WordPress Shortcode with Variable
- Convert the_permalink() function output into string
- Add meta tags to a custom header
- Need php code’s output to display underneath a Divi Module
- WP_Query | IF within $args array | Help me only add specific arguments if the argument is not blank
- get_current_site() is undefined
- How to use mysql LIKE with wpdb?
- woocommerce related product title length
- Automatically Add Page Links to Nav Menu
- blank white page when post/update/change option etc
- Function sanitize_title() does not appear to be working
- Custom Ratings for Theme, Proper way to Refactor Code and Clean up Template File
- Using Wp_Query, Json to add Highcharts series data
- Query for user roles
- Use SCSSPHP to compile Theme Customizer Values into .SCSS files ready to compile to CSS
- writing an unique php function to be used on my website
- Displaying Event within two given time frames
- Let users upload image(s) to the post from front end
- How to prevent a function from running based on host (ie web vs local)?
- How to call custom function outside from the admin page?
- Is there a way to create a “copy post” link?
- Use of antispambot with $curauth->email
- Output product category link from WP_Query
- Adding onload to body for certain pages
- Delete images from media library when user deletes an image from ACF Gallery
- Reject all malicious URL requests functions.php
- What is the best way to set the post category (Custom Post Type) automatically based on the one of the tags assigned to the post?
- Change wordpress’ database data using ajax – how to get current user id?
- Best way to use variables in multiple functions?
- Notice: Undefined variable
- Cannot fetch posts with certain ‘product_cat’. WP_Query is empty
- How to override WooCommerce Order Item Meta with data from Cart?
- Taxonomy Child Term, Counter is staying on 0
- Access to “My Site” is missing from the admin bar
- How to redirect (301) trashed post to it’s parent taxonomy TERM ARCHIVE instead of 404 page
- Detect what link user clicks and Redirect to a specific page for logged in users only
- Offset with ajax load more posts duplicates
- How to call WordPress PHP file using external js file
- Need help with PHP functions
- Using get_theme_mod with checkbox to display content
- WordPress styling recent post
- Styling admin page rows in order of importance (checkboxes)
- Function not pulling image or text from custom post type
- Insert wordpress tags below posts via functions.php
- Break a WordPress function to run in patches and re-continue
- Pagenav Not appearing on custom Template
- syntax error unexpected ‘}’ at 364 line
- get_post_meta no longer working
- Highlight posts currently being edited on multiple editor site?
- My title is showing after the shortcode
- Load a Header in wordpress
- Trouble figuring out how to get my button to submit comment
- Shortcode to include PHP file, pass various parameters to include?
- Why can’t I include echo inside a variable? [closed]
- Adding multiple conditional tags in a function?
- Assign new post author IF another user in custom field on post transition
- Create and publish a new post every Monday, listing the post titles and links to the posts published during the previous week
- How do I change the Go To Categories link in the term_updated_messages
- WooCommerce – Show ‘Sales’ badge on variable products where only some variations have sales price [closed]