CPT: Item Secret Content (Sendback Element)
Filter ID: envato_castle/filters/developer/cpt/item_scrt/element/content
Example: Add new repeater with two text boxes and merge with the builtin repeater TGM Plugins.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 | add_filter( 'envato_castle/filters/developer/cpt/item_scrt/element/content' , 'THEME_SLUG_ele_sendback_array' ); function THEME_SLUG_ele_sendback_array( $builtin_elemnts ) { $my_elemnts = array ( array ( 'id' => 'repeater_generic' , 'title' => esc_html__( 'Repeater Title' , 'YOUR_TEXT_DOMAIN' ), 'type' => 'repeater' , 'params' => array ( 'buttons' => array ( 'show_add' => false, 'show_delete' => true, 'show_collapse' => true, 'show_sort' => true, ), 'text' => array ( 'add_new' => esc_html__( 'Add New Demo' , 'YOUR_TEXT_DOMAIN' ) ) ), 'controls' => array ( array ( 'id' => 'title' , 'title' => esc_html__( 'Title' , 'YOUR_TEXT_DOMAIN' ), 'description' => esc_html__( 'Describe this content with couple words.' , 'YOUR_TEXT_DOMAIN' ), 'default' => '' , 'type' => 'text' , 'params' => array ( 'controls_source' => 'repeater' , 'js_title' => true, 'required' => true, ) ), array ( 'id' => 'url' , 'title' => esc_html__( 'Demo URL' , 'YOUR_TEXT_DOMAIN' ), 'description' => esc_html__( 'Describe this content with couple words.' , 'YOUR_TEXT_DOMAIN' ), 'default' => '' , 'type' => 'text' , 'params' => array ( 'required' => true, ) ), ) ), ); return array_merge ( $builtin_elemnts , $my_elemnts ); } |