plugin operation launch every time i click on page
plugin operation launch every time i click on page
plugin operation launch every time i click on page
var el = wp.element.createElement var withSelect = wp.data.withSelect wp.blocks.registerBlockType(‘voucher/shortcode’, { title: ‘Voucher Shortcode’, icon: ‘smiley’, category: ‘common’, attributes: { category: { type: ‘string’, } }, edit: withSelect( function( select ) { var pages = select(‘core’).getEntityRecords(‘postType’, ‘voucher’, { per_page: -1 }); return { posts: pages }; } ) (function(props) { if ( ! props.posts ) { … Read more
I don’t know why this happened, but it seems that register_setting shouldn’t be in the callback of add_settings_field // no actual code // this worked add_settings_field(‘id’,’title’, /*callback*/ function($arguments) {echo $htmlcode;}), ‘page’, ‘section’); register_setting(‘option_group’, ‘option_name’); I hope this helps
Registration Forms
Block Filters are used to customize the class that wordpress already adds using following format wp-block-[plugin_name]-[block-name]. You can access that using this.props.className. You can also add the additional classes using Advanced Panel which is present on right sidebar. In the end you can use React.js component state to define custom classes (pseudo code is given … Read more
wp_insert_uses (trac) the following loop to handle meta_input, if ( ! empty( $postarr[‘meta_input’] ) ) { foreach ( $postarr[‘meta_input’] as $field => $value ) { update_post_meta( $post_ID, $field, $value ); } } So if you change meta_input in your new post args to be like this, ‘meta_input’ => array( ‘invocies’ => array( ‘service’ => $_POST[‘service’], … Read more
Found a solution, although you have to change your premise a bit. Really can not add more than one metabox that uses a common draw and save callback. The names have to unique for the fields, just like in standard form processing. So what I did it this 1 metabox, with my variation of repeatable … Read more
You can use add_permastruct() (with ep_mask set to EP_AUTHORS) to add the proper rewrite rules, and the author_link filter to set the proper author URL: add_action( ‘init’, function(){ add_permastruct( ‘%author_trip_vendor%’, ‘operator/%author%’, [ ‘ep_mask’ => EP_AUTHORS, ] ); } ); add_filter( ‘author_link’, function( $link, $author_id, $author_nicename ){ if ( user_can( $author_id, ‘trip_vendor’ ) ) { $link … Read more
Adding body class in author page for custom role
How to make a plugin api route have permission?