Trouble with WordPress Settings API: Form Submits When Fields Called Directly, Fails When Using Callbacks

Thank you for the responses Tom! You got me on track, I should have checked the rendered html earlier. Here’s the answer. The rendered html was showing hidden inputs, for clarity, I’ll just repeat my previous form with the hidden inputs that were being rendered: <form method=”post” action=”<?php echo admin_url(‘admin-post.php’); ?>”> <label>This form wont work</label> … Read more

Attributes array not saving values

The best way to achieve what i was wanting to do was to use the core blocks for latest post. Then style as I needed to. Here is what my code looks like. import { registerBlockType } from “@wordpress/blocks”; import { __ } from “@wordpress/i18n”; import { useBlockProps, InnerBlocks, } from “@wordpress/block-editor”; registerBlockType(‘sfs-test-header-para-block/sfs-test-header-para-container-block’, { title: … Read more

Display box in sidebar of custom post type

It’s really easy, it’s called meta box and you can create one with the following code. /** * Register meta box(es). */ function plugin_prefix_register_meta_boxes() { add_meta_box( ‘meta-box-id’, __( ‘My Meta Box’, ‘textdomain’ ), ‘plugin_prefix_my_display_callback’, ‘custom_post_type’ ); } add_action( ‘add_meta_boxes’, ‘plugin_prefix_register_meta_boxes’ ); /** * Meta box display callback. * * @param WP_Post $post Current post object. … Read more