You are looking at type casting: http://php.net/manual/en/language.types.type-juggling.php
What the code does is caste the value returned by get_option()
to an array. It is being done so that array_merge()
works correctly and doesn’t trigger warnings/errors. That much is pure PHP and is off-topic. The only reason I chose to answer rather than to post a comment is because the return value of get_option()
will return various types of data depending on context. You can see that noted in the source:
@param bool|mixed $pre_option Value to return instead of the option
value.https://core.trac.wordpress.org/browser/tags/4.0/src/wp-includes/option.php#L42
That means that you have to manipulate the return data in order to be sure of the type of data that you are dealing with.
Related Posts:
- How to store the_title() into a variable to reutrn the value, not just echo it
- Need to get specific data from array
- Create an array from an array
- Check if term object is in array
- get a simple array of all of the term names that exist in all taxonomies
- Populate dropdown with Child Pages based on Parent Page chosen
- foreach loop still echoes array
- Checking array against author id in loop
- Alter required message using comment form api
- wp_force_remove_style’ not found
- How to fix this warning:call_user_func_array() expects exactly 2 parameters, 1 given in D:\wamp\www\…….\wp-includes\class-wp-hook.php on line 286
- Filtering a function’ output for a new continued function
- How to use array in function to get only value I want
- Warning: in_array() null given in PHP function
- Loop over Array and get the distinct ids
- If Array Values Match Another Array’s Values, Then
- Only load certain artists on this page
- How to make sure relative URL works when site is not on root domain?
- Custom functions for string data calculations
- Store custom field’s multiple values in one user meta key
- Fatal error when using array_diff() function inside of wp_update_nav_menu hook?
- Display posts using post ID’s in an array
- Page returning ID from array, how to return the correct values for post in acf wordpress
- Display a post based on its metabox selection
- Showing all post from all post type in admin backstage
- Custom WordPress Function – Adding items from Foreach Loop into an array and Updating Field based on array of IDs (ACF + WooCommerce)
- Replace block content with an array
- How to deprecate a function used in a plugin?
- How to manually fix the WordPress gallery code using PHP in functions.php?
- adding a filter to a shortcode?
- Change the footer text on the login page
- Displaying post per day
- Rewriting search and pagination base
- Copyright info change in Theme Child PHP
- How to Populate the list of custom post type categories
- Php string not working in WordPress Functions.php [duplicate]
- Problem with ACF shortcode with Repeater Field in WordPress? [closed]
- Why is PHP Cookie via plugin only set when logged in as Admin and not regular users? and other questions
- Insert After Second Paragraph Without Tag?
- Is the regular ajax request method safe or I should use admin-ajax.php?
- Using wp_get_image_editor in a standalone script
- Can I change a variable in a content part while calling it?
- page template for attachement page?
- PHP Deprecated: WP_RSSjb has a deprecated constructor
- Must Use Plugin Causing Query Error
- Shortcode return function with link href inside PHP
- Set WordPress Default Template
- PHP get the first post separately from array returned by wpdb->get_results()
- Can’t get page content in WordPress
- How can I add multiple ‘tax_query’ arrays via a loop?
- Showing content from one page on another
- How to insert a single row to WP database table?
- Get date numerical and separate?
- How to check if a meta value has already been assigned to any user?
- How to call plugin function per site in a multisite?
- Unique icons next to each WordPress menu item
- REQUIRED: get_bloginfo(‘template_url’) was found in the file search.php. Use get_template_directory_uri() instead
- How to use if statement in an array? [closed]
- How to check if a PHP string is different than meta field?
- Displaying posts based on category
- Countdown to date function?
- calling a custom field value inside functions.php
- Noindex Posts From Certain Authors In WordPress
- Show all tags within a category?
- WordPress check if current taxonomy has child
- how to make an array of post id’s in is_single
- This function is deprecated; use mysql_real_escape_string() instead
- get_theme_mod outputs number when using WP_Customize_Cropped_Image_Control
- array_rand not working correctly?
- How can I alter this code to accept a slug as well as an ID?
- Enqueueing a code block from an options framework
- Conditional On custom field plugin metabox
- Adding a ‘style=’ bit to image_send_to_editor output
- Post Views Code Hacks
- Closing WP_LINK_PAGES DIV ID w/After Argmuent
- Exclude function from running on a certain page
- Auto create Nextgen Gallery on post creation [closed]
- Hide media for non logged in users
- Jetengine Forms – Media upload path
- Custom function that re-writes page title breaks when the Yoast plugin is activated
- is_front_page is not working in my functions.php
- Is it possible to update the dataset using update_post_meta
- update_user_meta as multiple value but with same meta key
- Hide payment method based on user role AND minimum cart value
- How can I show how much water got saved on this order (making use of the number of items bought) on a thank-you-page?
- Update $wpdb query with AJAX
- Permalink changes after several minutes after saving post
- how to use auth_redirect() redirect visitor to login page if they are not login when they click account and order page?
- Make sticky post with FacetWP
- All categories options or All categories not Populating
- Wrapping shortcode content in a span or link
- How to use foreach and if statement within array of arrays?
- Permission functions within wordpress
- WordPress display name string manipulation
- 2 small questions: How to redirect to a created page & show that pages title in wp, bp
- How do I get Roboto Google Font to display normal font-style? [closed]
- which table updated after logout?
- Accessing WordPress Functions get_permalink() in Vanilla PHP?
- Loop on a wordpress Page instead of content coming from the WP text editor
- Saving User Input to PHP Variable