Tel: +44 (0) 1892249038
Shopping cart
DreamEditor is a powerful WordPress plugin designed to empower clients by granting them direct access to edit specific Advanced Custom Fields (ACF) on the frontend of their websites. With DreamEditor, clients can seamlessly make adjustments to key elements without the need to navigate through the backend, streamlining their workflow and enhancing their overall user experience. By offering this intuitive solution, DreamEditor simplifies the process of content management, putting control directly into the hands of clients and enabling them to effortlessly tailor their websites to meet their evolving needs and preferences.
Installation
Your welcome email should contain a link to you account where you can download the latest version of Dream Editor. Alternatively, your Order Received page contains a link called “View API Downloads” where you can download the plugin. If you didn’t receive the email, or the download link isn’t working, then please contact help.
- Download the latest version
- Ensure the downloaded files are still in a zip file (sometimes these get unzipped).
- Navigate to the “Add New Plugin” page on your website and click on “Upload Plugin” button at the top of the page.�
- Click on the “Choose file” button and select the dreameditor zip file.�
- Once uploaded click on “activate”
- That’s it, DreamEditor has been installed.�
Now DreamEditor is installed,you’ll need to include a fallback function in your theme. Simply open the functions.php file in your preferred text editor and copy-paste the provided code into it
if( ! function_exists('dreameditor_func') ) { function dreameditor_func( $callback ) { if( ! is_callable($callback) ) { return; } $args = array_slice(func_get_args(), 1); $value = call_user_func_array($callback, $args); return $value; } }
Activation
Before you can start using Dream Editor, we need to verify your installation. To do this, you need to enter a “Product order API Key” and the ”Product ID”. These can be found by visiting your account from the shop website (https://shop.twohourssleep.com/my-account).
- From my account click on API Keys from the navigation sidebar.
- On the API Keys page, location Dream Editor in the table and make a note of the API Key and Product ID.
If you do not see Dream Editor listed on the table, then please contact us.�
Next we need to enter the data into your site.
- From your WordPress admin dashboard,
- Navigate to the settings tab, find “Dream Editor Activation” from the sub menu and click the link.
- On the “API Key Activation” add your API key to the “API Key” field and the product ID to the “Product ID” field.�
- Click on save changes
If the credentials were verified your status will say “Activated” and there will be some additional information about your purchase. If this was unsuccessful, and your key/product ID are correct, then please contact us.�
Quick Start
In this section, we’ll guide you through the process of integrating DreamEditor into basic fields. It’s a straightforward procedure where you’ll create an array of options within our function. Then, you’ll output the DreamEditor function to the parent element attributes of the Advanced Custom Fields (ACF) fields by using the ‘echo’ command. This allows you to seamlessly incorporate DreamEditor functionality into your basic fields, enhancing their capabilities effortlessly.
Every field follows a simple array structure comprising two essential fields. The first one is “Field_name”, which should mirror the name of your ACF field. For instance, if your ACF field is named “main_title,” then your DreamEditor field should also be “main_title.” The second required field is “field_type,” which indicates the type of ACF field you intend to manage.
Text
Text area
Number
URL
Link
Image
WYSIWYG
Text
The text field is a basic text input, its used to store small content strings.
<?php $content_editable_args = [ 'field_name' => 'main_title', 'field_type' => 'text', ]; ?> <h1 <?php echo dreameditor_func('dreameditor_field_args',$content_editable_args); ?>><?php echo get_field('main_title') ?></h1>
Text area
The text area field is useful to store simple (i.e., unstyled) paragraphs of text to use in your theme.
<?php $content_editable_args = array( 'field_name' => 'basic_content', 'field_type' => 'text_area', ); ?> <p <?php echo dreameditor_func('dreameditor_field_args',$content_editable_args); ?>><?php echo get_field('basic_content'); ?></p>
Number
The Number field stores an input limited to numerical values.
<?php $content_editable_args = array( 'field_name' => 'arbitary_number', 'field_type' => 'number', ); ?> <span <?php echo dreameditor_func('dreameditor_field_args',$content_editable_args); ?>><?php echo get_field('arbitary_number'); ?></span>
The Email field is used for storing email address values.
<?php $content_editable_args = array( 'field_name' => 'email_address', 'field_type' => 'email', ); ?> <span <?php echo dreameditor_func('dreameditor_field_args',$content_editable_args); ?>><?php echo get_field('email_address'); ?></span>
URL
The URL field is a text input specifically designed for storing web addresses.
<?php $content_editable_args = array( 'field_name' => 'website', 'field_type' => 'url', ); ?> <span <?php echo dreameditor_func('dreameditor_field_args',$content_editable_args); ?>><?php echo get_field('website'); ?></span>
Link
The Link field allows a link to be selected or defined (url, title, target)
<?php $content_editable_args = array( 'field_name' => 'call_to_action', 'field_type' => 'link', ); $call_to_action = get_field('call_to_action'); ?> <a <?php echo dreameditor_func('dreameditor_field_args',$content_editable_args); ?> href="<?php echo isset($call_to_action['url']) ? $call_to_action['url'] : ''; ?>"> <?php echo isset($call_to_action['title']) ? $call_to_action['title'] : ''; ?> </a>
Image
The Image field allows an image to be uploaded and selected by using the native WordPress media modal.
<?php $content_editable_args = array( 'field_name' => 'main_image', 'field_type' => 'image', ); $main_image = get_field('main_image'); ?> <img <?php echo dreameditor_func('dreameditor_field_args',$content_editable_args); ?> src="<?php echo isset($main_image['sizes']['large']) ? $main_image['sizes']['large'] : ''; ?>" alt="<?php echo isset($main_image['alt']) ? $main_image['alt'] : ''; ?>">
WYSIWYG
The Wysiwyg field creates a WordPress content editor as seen in Posts and Pages. Wysiwyg is an acronym for “what you see is what you get”.
This is one of the most useful fields for editing content as it allows for both text and multimedia to be edited and styled within a single area.
<?php $content_editable_args = array( 'field_name' => 'main_content', 'field_type' => 'wysiwyg', ); ?> <div <?php echo dreameditor_func('dreameditor_field_args',$content_editable_args); ?>> <?php echo get_field('main_content'); ?> </div>
Advanced usage
Advanced usage operates similarly to standard usage, but with an additional option to configure in the array structure known as “field_path.” This option is particularly useful for fields that contain additional nested fields within their structure. You can see examples of these below.
To determine the path name, begin with the name of your primary field. For instance, if your primary field is named ‘main_group,’ your path would be ‘main_group.’ However, if your primary field is either a Repeater or Flexible Content, we must consider the iteration we intend to edit. To achieve this, we create a counter for the while loop and append it to the end of the path. For instance, ‘main_repeater_0’ would target the first iteration in your loop.
It’s crucial to consider any fields nested within groups or repeaters. For instance, if you have a repeater containing a group, this nesting should be reflected in the field path. To accomplish this, we append the name of each nested field to our path. For example, ‘main_repeater_0_group_name’ would correctly identify a field within the nested structure.
Groups
Repeaters
Flexible Content
Groups
The Group field uses both the parent and child field names when saving and loading values. For example, a Group field named ‘hero’ with a sub field named ‘image’ will be saved to the database using the meta name ‘hero_image’.
<?php $group = get_field('group_name'); if( $group ) : ?> <?php $content_editable_args = [ 'field_name' => 'main_title', 'field_type' => 'text', 'field_path' => 'group_name' ]; ?> <h1 <?php echo dreameditor_func('dreameditor_field_args',$content_editable_args); ?>><?php echo $group['main_title'] ?></h1> <?php endif; ?>
Repeaters
This field type acts as a parent to a set of sub fields which can be repeated again and again. What makes this field type so special is its versatility. Any kind of field can be used within a Repeater, and there are no limits to the number of repeats either.
<?php if( have_rows('repeater_name') ) : $index = 0; while( have_rows('repeater_name') ) : the_row(); $main_title = get_sub_field('main_title'); $thumbnail = get_sub_field('thumbnail'); ?> <?php $content_editable_args = [ 'field_name' => 'main_title', 'field_type' => 'text', 'field_path' => sprintf('repeater_name_%s', $index) ]; ?> <h1 <?php echo dreameditor_func('dreameditor_field_args',$content_editable_args); ?>><?php echo $main_title; ?></h1> <?php $content_editable_args = [ 'field_name' => 'thumbnail', 'field_type' => 'image', 'field_path' => sprintf('repeater_name_%s', $index) ]; ?> <img <?php echo dreameditor_func('dreameditor_field_args',$content_editable_args); ?> src="<?php echo $thumbnail['sizes']['thumbnail']; ?>" alt="<?php echo $thumbnail['alt']; ?>"> <?php $index++; endwhile; endif; ?>
Flexible Content
The Flexible Content field provides a simple, structured, block-based editor.
Using layouts and sub fields to design the available blocks, this field type acts as a blank canvas to which you can define, create and manage content with total control.
<?php if( have_rows('flexible_content_name') ) : $index = 0; while( have_rows('flexible_content_name') ) : the_row(); if( get_row_layout() === 'hero' ) : $main_title = get_sub_field('main_title'); $content_editable_args = [ 'field_name' => 'main_title', 'field_type' => 'text', 'field_path' => sprintf('flexible_content_name_%s', $index) ]; ?> <h1 <?php echo dreameditor_func('dreameditor_field_args',$content_editable_args); ?>><?php echo $main_title; ?></h1> <?php endif; $index++; endwhile; endif; ?>
Changlog
Demo
Site details:
User: demo
Password: d6f841559c20
WordPress login:
User:demo
Password:fAn(bw3jx4fMyr0Hxrc5PUNH
Note: You use the THS DreamEditor, please login with the detail above.�
URL:https://dreamtheme1.wpengine.com
Admin URL:https://dreamtheme1.wpengine.com/wp-admin
This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.
Strictly Necessary Cookie should be enabled at all times so that we can save your preferences for cookie settings.
Cookie key | Domain | Path | Cookie type | Expiration | Description |
---|---|---|---|---|---|
__cf_bm | .brevo.com | / | Third-party | 30 minutes | This cookie is used to distinguish between humans and bots. This is beneficial for the website, in order to make valid reports on the use of their website. |
AWSALBCORS | conversations-widget.brevo.com | / | Third-party | 7 days | For continued stickiness support with CORS use cases after the Chromium update, we are creating additional stickiness cookies for each of these duration-based stickiness features named AWSALBCORS (ALB). |
__cf_bm | .vimeo.com | / | Third-party | 30 minutes | This cookie is used to distinguish between humans and bots. This is beneficial for the website, in order to make valid reports on the use of their website. |
nitroCachedPage | www.twohourssleep.com | / | Third-party | Session | This cookie sets the cached status of the viewed page. This speeds up page delivery. |
tweolvc8 | www.twohourssleep.com | / | First-party | 5 days | Plugin |
903ezqhg | www.twohourssleep.com | / | First-party | 5 days | Plugin |
sib_cuid | www.twohourssleep.com | / | First-party | 6 months 1 day | Plugin |
uuid | sibautomation.com | /cm.html?key=hvb7jsusa77rbuhpmy1sv3j0 | Third-party | Varies | Used for tracking and automation purposes. |
Storages
Storage key | Type | Category |
---|---|---|
bot_detector_screen_info | local | Strictly Necessary |
bot_detector_event_token | local | Strictly Necessary |
bot_detector_page_hits | local | Strictly Necessary |
bot_detector_user_agent | local | Strictly Necessary |
bot_detector_headless | local | Strictly Necessary |
bot_detector_referrer | local | Strictly Necessary |
bot_detector_referrer_previous | local | Strictly Necessary |
bot_detector_mouse_moved | local | Strictly Necessary |
bot_detector_pointer_data | local | Strictly Necessary |
bot_detector_browser_supports_cookies | local | Strictly Necessary |
bot_detector_has_scrolled | local | Strictly Necessary |
If you disable this cookie, we will not be able to save your preferences. This means that every time you visit this website you will need to enable or disable cookies again.
This website uses the following additional cookies:
Cookie key | Domain | Path | Cookie type | Expiration | Description |
---|---|---|---|---|---|
_ga_PVM764X7D0 | .twohourssleep.com | / | First-party | 1 year 1 month | This cookie is used by Google Analytics to persist session state. |
_ga | .twohourssleep.com | / | First-party | 1 year 1 month | This cookie name is associated with Google Universal Analytics - which is a significant update to Google's more commonly used analytics service. This cookie is used to distinguish unique users by assigning a randomly generated number as a client identifier. It is included in each page request in a site and used to calculate visitor, session and campaign data for the sites analytics reports. |
test_cookie | .doubleclick.net | / | Third-party | 15 minutes | This cookie is set by DoubleClick (which is owned by Google) to determine if the website visitor's browser supports cookies. |
uuid | sibautomation.com | / | Third-party | 6 months 1 day | This cookie is used to optimize ad relevance by collecting visitor data from multiple websites – this exchange of visitor data is normally provided by a third-party data-center or ad-exchange. |
_gcl_au | .twohourssleep.com | / | First-party | 3 months | Used by Google AdSense for experimenting with advertisement efficiency across websites using their services |
Please enable Strictly Necessary Cookies first so that we can save your preferences!
More information about our Cookie Policy