Skip to content

Instantly share code, notes, and snippets.

@merianos
Created December 5, 2015 13:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save merianos/47959167cecabce91872 to your computer and use it in GitHub Desktop.
Save merianos/47959167cecabce91872 to your computer and use it in GitHub Desktop.
Allow PageBuilder to see your custom fields
function register_unique_namespace( $class_prefixes = array() ) {
$class_prefixes[] = 'My_Custom_Field_';
return $class_prefixes;
}
add_filter( 'siteorigin_widgets_field_class_prefixes', 'register_unique_namespace' );
function register_my_custom_fields_folder( $class_paths = array() ) {
$class_paths[] = dirname( __FILE__ ) . '/fields/';
return $class_paths;
}
add_filter( 'siteorigin_widgets_field_class_paths', 'register_my_custom_fields_folder' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment