This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Target a row higher in the DOM using style-attr for temp-class | |
* @example shortcode: [targetrow field="backgroundurl" removemodule="true"] | |
* this will use the posts ACF backgroundurl as a value for the background-image, | |
* it will also remove the module in the DOM so that when used on a row without any HTML or editor module it will still be silent. | |
* | |
* @param $atts attributes, field is required; | |
* @return [type] [description] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter( 'bbacf/helpers/sc_attr/type=google_map' , 'add_color_sc_attribute' ); | |
/** | |
* add the postid attribute to the default sc attr | |
* @param [type] $array [description] | |
* @return [type] [description] | |
*/ | |
function add_color_sc_attribute( $array ) { | |
return array_merge( | |
$array, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter( 'bbacf/helpers/get_acf_field/type=google_map' , 'add_red_border' , 11, 5 ); | |
/** | |
* add a colored border, using the added sc attr color | |
* @param [type] $string [description] | |
* @param [type] $field_object [description] | |
* @param [type] $value [description] | |
* @param [type] $atts [description] | |
* @param [type] $postid [description] | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
remove_filter( 'bbacf/helpers/get_acf_field/type=checkbox' , 'bbacf_helpers::shortcode_acf_return_checkbox' ,10 ); | |
add_filter( 'bbacf/helpers/get_acf_field/type=checkbox' , 'return_custom_acf_checkbox' , 11, 5 ); | |
function return_custom_acf_checkbox ( $string , $field_object , $value , $atts = null , $postid = null ) { | |
// get the correct fieldname for version 4 or 5 of acf | |
$get_fo = bbacf_helpers::$fr[ bbacf_acf_version() ]; | |
if ( $field_object[ 'type' ] == 'text' ) return $string . $value ; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter( 'bbacf/helpers/get_acf_field/type=font-awesome' , 'return_custom_acf_fontawesome' , 10, 5 ); | |
/** | |
* return rotated font-awesome icon | |
* @param [type] $string [description] | |
* @param [type] $field_object [description] | |
* @param [type] $value [description] | |
* @param [type] $atts [description] | |
* @param [type] $postid [description] | |
* @return [type] [description] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// ATTENTION: | |
// first you will need to add 2 lines of code (only lines 9+10, the } else if () { ) to the current oxygen-dynamic-shortcode.php file in Oxygenbuilder 2.0-Alpha2/3 | |
// it is located within the oxygen_vsb_dynamic_shortcode class-function | |
// | |
// if (method_exists($this, $handler)) { | |
// $output = call_user_func(array($this, $handler), $atts); | |
// } else if (class_exists('Dynamic_Shortcodes_' . $atts['data']) && in_array( 'Oxygen_VSB_Dynamic_Shortcodes', class_parents('Dynamic_Shortcodes_' . $atts['data']) ) ){ | |
// $output = call_user_func( array( 'Dynamic_Shortcodes_' . $atts['data'] , 'output' ) , $atts ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Add an 'edit with Oxygen' button on set posttypes, use filter ct_post_types to add to the array; | |
*/ | |
// add a filter to add my cpt's | |
add_filter( 'ct_post_types', 'example_add_my_custom_post_types' , 10 ,1 ); | |
// merge arrays | |
function example_add_my_custom_post_types( $post_types ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action( 'toolbox_add_conditional_options' , 'add_some_new_conditional_feature', 10, 1 ); | |
function add_some_new_conditional_feature() { | |
toolboxExtender::add_conditional_option( | |
// filter name | |
'conditional_filter_check_parameter', | |
// option key and title | |
array('key'=> 'check_parameter' , 'title' => __('Check URL Parameter', 'textdomain') ), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// simple example of a conditional filter | |
add_filter( 'conditional_filter_check_userloggedin' , 'my_check_userloggedin' ,10 ,2 ); | |
function my_check_userloggedin( $is_visible , $node ) { | |
return is_user_logged_in(); | |
} |
OlderNewer