March 27, 2023 4:24 am

TTC/USD : $0.0021

Advertise with Trentimes

Create an official Advertisement page for your item or brand.

(String) A unique name that identifies the block (without namespace).
Note: A block name can only contain lowercase alphanumeric characters and dashes, and must begin with a letter.

(String) (Optional) This is a short description for your block.

(String) Blocks are grouped into categories to help users browse and discover them. The core provided categories are [ common | formatting | layout | widgets | embed ]. Plugins and Themes can also register custom block categories.

(Array) (Optional) An array of search terms to help user discover the block while searching.
One line for each keyword. ie:

quote
mention
cite

(Array) (Optional) An array of post types to restrict this block type to.

(String) (Optional) The display mode for your block. Available settings are “auto”, “preview” and “edit”. Defaults to “preview”.

auto: Preview is shown by default but changes to edit form when block is selected.
preview: Preview is always shown. Edit form appears in sidebar when block is selected.
edit: Edit form is always shown.

Note. When in “preview” or “edit” modes, an icon will appear in the block toolbar to toggle between modes.

(String) (Optional) The default block alignment. Available settings are “left”, “center”, “right”, “wide” and “full”. Defaults to an empty string.

Simple: Specify a Dashicons class or SVG path
Colors: Specify colors & Dashicons class

(String) (Optional) An icon property can be specified to make it easier to identify a block. These can be any of WordPress’ Dashicons, or a custom svg element.

Specifying a background color to appear with the icon e.g.: in the inserter.

Specifying a color for the icon (optional: if not set, a readable color will be automatically defined)

Specifying a dashicon for the block

(String) The path to a template file used to render the block HTML. This can either be a relative path to a file within the active theme or a full path to any file.

(Callable) (Optional) Instead of providing a render_template, a callback function name may be specified to output the block’s HTML.

(String) (Optional) The url to a .css file to be enqueued whenever your block is displayed (front-end and back-end).

(String) (Optional) The url to a .js file to be enqueued whenever your block is displayed (front-end and back-end).

(Callable) (Optional) A callback function that runs whenever your block is displayed (front-end and back-end) and enqueues scripts and/or styles.

This property adds block controls which allow the user to change the block’s alignment. Defaults to true. Set to false to hide the alignment toolbar. Set to an array of specific alignment names to customize the toolbar.

Set to an array of specific alignment names to customize the toolbar.
One line for each name. ie:

left
right
full

Enable inner block feature. Defaults to false.

Set the "xy" position of content using a 3×3 matrix grid. Defaults to false.

Specifies the default attribute value.

This property allows the user to toggle between edit and preview modes via a button. Defaults to true.

This property allows the block to be added multiple times. Defaults to true.

The unique form slug

Render & map fields of the following field groups

Add actions on form submission
No field groups are currently mapped

Click the "Add action" button below to start creating your layout
0 Custom action

Set a unique action slug

You may use the following hooks:

add_action('acfe/form/validation/my-custom-action''my_form_custom_action_validation'103);
add_action('acfe/form/validation/my-custom-action/form=my_form''my_form_custom_action_validation'103);

/**
 * @array   $form       The form settings
 * @int     $post_id    Current post ID
 * @string  $alias      Action alias (Empty for custom actions)
 */
add_action('acfe/form/validation/my-custom-action''my_form_custom_action_validation'103);
function 
my_form_custom_action_validation($form$post_id$alias){
    
    
/**
     * Get the form input value named 'my_field'
     * This is the value entered by the user during the form submission
     */
    
$my_field get_field('my_field');
    
$my_field_unformatted get_field('my_field'falsefalse);
    
    if(
$my_field === 'Hello'){
        
        
// Add validation error
        
acfe_add_validation_error('my_field''Hello is not allowed');
        
    }
    
    
    
/**
     * Get the field value 'my_field' from the post ID 145
     */
    
$post_my_field get_field('my_field'145);
    
$post_my_field_unformatted get_field('my_field'145false);
    
}
You may use the following hooks:

add_action('acfe/form/submit/my-custom-action''my_form_custom_action'102);
add_action('acfe/form/submit/my-custom-action/form=my_form''my_form_custom_action'102);

/**
 * @array   $form       The form settings
 * @int     $post_id    Current post ID
 */
add_action('acfe/form/submit/my-custom-action''my_form_custom_action'102);
function 
my_form_custom_action($form$post_id){
    
    
/**
     * Get the value from the form input named 'my_field'
     * This is the value entered by the user during the form submission
     */
    
$my_field get_field('my_field');
    
    
    
/**
     * Get the field value 'my_field' from the post ID 145
     */
    
$my_post_field get_field('my_field'145);
    
    
    
/**
     * Set a custom query var
     * The value '145' can be retrieved in an another action using the template tag:
     * {query_var:my_tag}
     */
    
set_query_var('my_tag'145);
    
    
    
/**
     * Set a custom query var array
     * The values can be retrieved in an another action using the template tags:
     * {query_var:my_tag:post_id} {query_var:my_tag:user}
     */
    
set_query_var('my_tag', array(
        
'post_id' => 145,
        
'user' => 12,
    );
    
}
0 Email action
0 Option action

(Optional) Target this action using hooks.

Fill inputs with values

Alter the Option Post ID where meta values are loaded from

You may use the following hooks:

add_filter('acfe/form/load/option_id''my_form_option_values_source'103);
add_filter('acfe/form/load/option_id/form=my_form''my_form_option_values_source'103);
add_filter('acfe/form/load/option_id/action=my-post-action''my_form_option_values_source'103);

/*
 * @int     $option_id  Option Post ID used as source
 * @array   $form       The form settings
 * @string  $action     The action alias name
 */
add_filter('acfe/form/load/option_id/form=my_form''my_form_option_values_source'103);
function 
my_form_option_values_source($option_id$form$action){
    
    
/*
     * Retrieve Form Setting
     */
    
if($form['custom_key'] === 'custom_value'){

        
// Force to load values from the Option Post ID 'my_options'
        
$option_id 'my_options';
        
    }
    
    return 
$option_id;
    
}

Alter the Options Post ID before database insert/update

You may use the following hooks:

add_filter('acfe/form/submit/option_id''my_form_option_id_save'103);
add_filter('acfe/form/submit/option_id/form=my_form''my_form_option_id_save'103);
add_filter('acfe/form/submit/option_id/action=my-post-action''my_form_option_id_save'103);

/*
 * @int     $option_id  Targeted Option Post ID
 * @array   $form       The form settings
 * @string  $action     The action alias name
 */
add_filter('acfe/form/submit/option_id/form=my_form''my_form_option_id_save'103);
function 
my_form_option_id_save($option_id$form$action){

    
/*
     * Get the form input value named 'my_field'
     * This is the value entered by the user during the form submission
     */
    
$my_field get_field('my_field');

    if(
$my_field === 'Company'){
    
        
// Change Option Post ID
        
$option_id 'my_options';
    
    }

    
/*
     * Get previous Post Action output
     */
    
$prev_post_action acfe_form_get_action('post');
    
    if(!empty(
$prev_post_action)){
    
        if(
$prev_post_action['post_title'] === 'Company'){
    
            
// Change Option Post ID
            
$option_id 'my_options';
            
        }

    }
    
    
// Do not save the Options
    // return false;
    
    
return $option_id;
    
}

This action allows you to hook in before or after the meta data have been saved

You may use the following hooks:

add_action('acfe/form/submit/option''my_form_option_save'103);
add_action('acfe/form/submit/option/form=my_form''my_form_option_save'103);
add_action('acfe/form/submit/option/action=my-post-action''my_form_option_save'103);

/*
 * @int     $option_id  Targeted Option Post ID
 * @array   $form       The form settings
 * @string  $action     The action alias name
 *
 * Note: At this point the options & meta fields are already saved in the database
 */
add_action('acfe/form/submit/option/form=my_form''my_form_option_save'103);
function 
my_form_option_save($option_id$form$action){

    
/*
     * Get the form input value named 'my_field'
     * This is the value entered by the user during the form submission
     */
    
$my_field get_field('my_field');

    if(
$my_field === 'Company'){
    
        
// do_something();
        
    
}

    
/*
     * Get previous Post Action output
     */
    
$prev_post_action acfe_form_get_action('post');
    
    if(!empty(
$prev_post_action)){
        
        if(
$prev_post_action['post_title'] === 'Company'){
            
            
// do_something();
            
        
}
        
    }
    
}
0 Post action

(Optional) Target this action using hooks.

Click to initialize TinyMCE

Fill inputs with values

Alter the post ID where meta values are loaded from

You may use the following hooks:

add_filter('acfe/form/load/post_id''my_form_post_values_source'103);
add_filter('acfe/form/load/post_id/form=my_form''my_form_post_values_source'103);
add_filter('acfe/form/load/post_id/action=my-post-action''my_form_post_values_source'103);

/*
 * @int     $post_id  Post ID used as source
 * @array   $form     The form settings
 * @string  $action   The action alias name
 */
add_filter('acfe/form/load/post_id/form=my_form''my_form_post_values_source'103);
function 
my_form_post_values_source($post_id$form$action){
    
    
/*
     * Retrieve Form Setting
     */
    
if($form['custom_key'] === 'custom_value'){

        
// Force to load values from the Post ID 145
        
$post_id 145;
        
    }
    
    return 
$post_id;
    
}

Alter the post arguments before database insert/update

You may use the following hooks:

add_filter('acfe/form/submit/post_args''my_form_post_args'104);
add_filter('acfe/form/submit/post_args/form=my_form''my_form_post_args'104);
add_filter('acfe/form/submit/post_args/action=my-post-action''my_form_post_args'104);

/*
 * @array   $args    The generated post arguments
 * @string  $type    Action type: 'insert_post' or 'update_post'
 * @array   $form    The form settings
 * @string  $action  The action alias name
 */
add_filter('acfe/form/submit/post_args/form=my_form''my_form_post_args'104);
function 
my_form_post_args($args$type$form$action){
    
    
// Change Post Title if the Action Type is 'insert_post'
    
if($type === 'insert_post'){
        
        
$args['post_title'] = 'My title';
        
    }

    
/*
     * Get the form input value named 'my_field'
     * This is the value entered by the user during the form submission
     */
    
$my_field get_field('my_field');

    if(
$my_field === 'Company'){
    
        
// Change Post Title
        
$args['post_title'] = 'Company';
    
    }

    
/*
     * Get previous Post Action output
     */
    
$prev_post_action acfe_form_get_action('post');
    
    if(!empty(
$prev_post_action)){
    
        if(
$prev_post_action['post_title'] === 'Company'){
            
            
// Change Post Title
            
$args['post_title'] = 'Company';
            
        }

    }
    
    
// Do not save the Post
    // return false;
    
    
return $args;
    
}

This action allows you to hook in before or after the meta data have been saved

You may use the following hooks:

add_action('acfe/form/submit/post''my_form_post_save'105);
add_action('acfe/form/submit/post/form=my_form''my_form_post_save'105);
add_action('acfe/form/submit/post/action=my-post-action''my_form_post_save'105);

/*
 * @int     $post_id  The targeted post ID
 * @string  $type     Action type: 'insert_post' or 'update_post'
 * @array   $args     The generated post arguments
 * @array   $form     The form settings
 * @string  $action   The action alias name
 *
 * Note: At this point the post & meta fields are already saved in the database
 */
add_action('acfe/form/submit/post/form=my_form''my_form_post_save'105);
function 
my_form_post_save($post_id$type$args$form$action){

    
/*
     * Get the form input value named 'my_field'
     * This is the value entered by the user during the form submission
     */
    
$my_field get_field('my_field');

    if(
$my_field === 'Company'){
    
        
// do_something();
        
    
}

    
/*
     * Get previous Post Action output
     */
    
$prev_post_action acfe_form_get_action('post');
    
    if(!empty(
$prev_post_action)){
        
        if(
$prev_post_action['post_title'] === 'Company'){
            
            
// do_something();
            
        
}
        
    }
    
}
0 Redirect action

(Optional) Target this action using hooks.

The URL to redirect to. See "Cheatsheet" tab for all available template tags.

Stop the action execution if necessary

You may use the following hooks:

add_filter('acfe/form/prepare/redirect''my_form_redirect_prepare'104);
add_filter('acfe/form/prepare/redirect/form=my_form''my_form_redirect_prepare'104);
add_filter('acfe/form/prepare/redirect/action=my-redirect-action''my_form_redirect_prepare'104);

/*
 * @bool    $prepare  Execute the action
 * @array   $form     The form settings
 * @int     $post_id  Current post ID
 * @string  $action   Action alias name
 */
add_filter('acfe/form/prepare/redirect/form=my_form''my_form_redirect_prepare'104);
function 
my_form_redirect_prepare($prepare$form$post_id$action){

    
/*
     * Get the form input value named 'my_field'
     * This is the value entered by the user during the form submission
     */
    
$my_field get_field('my_field');

    if(
$my_field === 'Company'){

        
// Do not execute Redirect
        
$prepare false;

    }

    
/*
     * Get previous Post Action output
     */
    
$prev_post_action acfe_form_get_action('post');

    if(!empty(
$prev_post_action)){

        if(
$prev_post_action['post_title'] === 'Company'){

            
// Do not execute Redirect
            
$prepare false;

        }

    }
    
    return 
$prepare;
    
}
You may use the following hooks:

add_filter('acfe/form/submit/redirect_url''my_form_redirect_url'103);
add_filter('acfe/form/submit/redirect_url/form=my_form''my_form_redirect_url'103);
add_filter('acfe/form/submit/redirect_url/action=my-redirect-action''my_form_redirect_url'103);

/*
 * @bool    $url     Redirect URL
 * @array   $form    The form settings
 * @string  $action  Action alias name
 */
add_filter('acfe/form/submit/redirect_url/form=my_form''my_form_redirect_url'103);
function 
my_form_redirect_url($url$form$action){
    
    
/*
     * Get the form input value named 'my_field'
     * This is the value entered by the user during the form submission
     */
    
$my_field get_field('my_field');
    
    if(
$my_field === 'Company'){
        
        
// Change Redirect URL
        
$url home_url('thank-you');
        
    }

    
/*
     * Get previous Post Action output
     */
    
$prev_post_action acfe_form_get_action('post');
    
    if(!empty(
$prev_post_action)){

        if(
$prev_post_action['post_title'] === 'Company'){

            
// Change Redirect URL
            
$url home_url('thank-you');

        }
        
    }
    
    
// Do not redirect
    // return false;
    
    
return $url;
    
}
0 Term action

(Optional) Target this action using hooks.

Click to initialize TinyMCE

Fill inputs with values

Alter the term ID where meta values are loaded from

You may use the following hooks:

add_filter('acfe/form/load/term_id''my_form_term_values_source'103);
add_filter('acfe/form/load/term_id/form=my_form''my_form_term_values_source'103);
add_filter('acfe/form/load/term_id/action=my-term-action''my_form_term_values_source'103);

/*
 * @int     $term_id  Term ID used as source
 * @array   $form     The form settings
 * @string  $action   The action alias name
 */
add_filter('acfe/form/load/term_id/form=my_form''my_form_term_values_source'103);
function 
my_form_term_values_source($term_id$form$action){

    
/*
     * Retrieve Form Setting
     */
    
if($form['custom_key'] === 'custom_value'){
    
        
// Force to load values from the Term ID 45
        
$term_id 45;

    }
    
    return 
$term_id;
    
}

Alter the term arguments before database insert/update

You may use the following hooks:

add_filter('acfe/form/submit/term_args''my_form_term_args'104);
add_filter('acfe/form/submit/term_args/form=my_form''my_form_term_args'104);
add_filter('acfe/form/submit/term_args/action=my-term-action''my_form_term_args'104);

/*
 * @array   $args    The generated term arguments
 * @string  $type    Action type: 'insert_term' or 'update_term'
 * @array   $form    The form settings
 * @string  $action  The action alias name
 */
add_filter('acfe/form/submit/term_args/form=my_form''my_form_term_args'104);
function 
my_form_term_args($args$type$form$action){
    
    
// Change Description if the Action Type is 'insert_term'
    
if($type === 'insert_term'){
        
        
$args['description'] = 'My term description';
        
    }
    
    
/*
     * Get the form input value named 'my_field'
     * This is the value entered by the user during the form submission
     */
    
$my_field get_field('my_field');
    
    if(
$my_field === 'Company'){
        
        
// Change Description
        </