For Developers
eos_tiny_posts
You can use it to add the Freesoul Tiny MCE editor to a custom post type. In the following example we add the editor to the custom post type ‘my_custom_post’.
function my_custom_function_add_tiny_post( $arr,$post_type ){ if( !in_array( 'my_custom_post',$arr ) ){ $arr[] = 'my_custom_post'; } return $arr; } add_filter( 'eos_tiny_posts','my_custom_function_add_tiny_post',40,2 );
eos_page_title
You can use it to filter the page title presence.
function my_custom_function_title_filter( $title_flag ){ global $post; return is_object( $post ) && 'your_custom_post' === $post->post_type ? 'true' : $title_flag; } add_filter( 'eos_page_title','my_custom_function_title_filter',40,1 );
eos_content_element_id
You can use it to change a content element in some conditions.
In this example we load a different footer (ID 2999) instead of the current one (ID 2519) on the pages having ID 471 and 2986
add_filter( 'eos_content_element_id','my_custom_change_footer_on_specific_pages' ); function mycustom_change_footer_on_specific_pages( $content_id ){ if( 2519 === $content_id ){ global $post; if( is_object( $post ) ){ if( in_array( $post->ID,array( 471,2986) ) ){ return 2999; } } } return $content_id; }
eos_before_header
It triggers just before the header. This hook provides no parameters. You can use it to add custom content before the header of each page
eos_after_header
It triggers just after the header. This hook provides no parameters. You can use it to add custom content after the header of each page
eos_before_footer
It triggers just before the footer. This hook provides no parameters. You can use it to add custom content before the footer of each page
eos_after_footer
It triggers just after the footer. This hook provides no parameters. You can use it to add custom content after the footer of each page
eos_before_posts
It triggers just before the loop in the blog page. This hook provides no parameters. You can use it to add custom content just before the posts or even to completely customize the blog page. In this last case remember to close your function with </div> and </section> as in the following example.
function my_custom_blog_page_content(){ //your markup and code here ?> </div> </section> <?php get_footer(); exit; } add_action( 'eos_before_posts','my_custom_blog_page_content' );
eos_before_main_single_content
It triggers just before the content in single post. This hook provides no parameters. You can use it to add custom content or even to completely customize the single post. In this last case remember to close your function with </section> as in the following example.
function my_custom_single_post_content(){ //your markup and code here ?> </section> <?php get_sidebar(); get_footer(); exit; } add_action( 'eos_before_main_single_content','my_custom_single_post_content' );
eos_after_contact_processed
It triggers after the contact form handler has successfully sent the email to the administrator (it will not fire if the email is not sent).
It requires 5 arguments:
- contact form id (string),
- contact form title (string),
- contact form user name (string),
- contact form user email (string),
- contact form user message (string)
EOS_DISABLE_REST_API
Adding the following line in your wp-config.php , you will disable the rest api
define( 'EOS_DISABLE_REST_API',true );
EOS_DISABLE_CART_FRAGMENTS
If you have e-commerce powered by WooCommerce, you don’t have a cart icon on the navigation showing the cart content on mouseover, and for performance purposes, you want to deactivate the automatic cart content update, just add the following line in your wp-config.php file:
define( 'EOS_DISABLE_CART_FRAGMENTS',true );
EOS_THEME_BETA_VERSION
Adding the following line in your wp-config.php file, you will have access to functions that are under developing and you don’t see in the stable Freesoul version.
define( 'EOS_THEME_BETA_VERSION',true );
These beta functionalities are neither covered by the documentation nor by our support.
EOS_ANTISPAM
Adding the following line in your wp-config.php file, you will deactivate the Freesoul anti-spam system for comments.
define( 'EOS_ANTISPAM',false );
You could need it just in case of debugging, in all other cases there is no reason to don’t protect your blog against spammers.
Freesoul Builder gives you the possibility to write your custom JavaScript code only for a specific page.
In case you need the Freesoul variables load before your code, wrap your script in the function eos_custom_page_script.
function eos_custom_page_script(){ Â Â //Your code here }