Displaying Shortcodes Inside Form Label Fields

/** * Run shortcodes on the form label field. * * @link https://wpforms.com/developers/how-to-display-shortcodes-inside-the-label-of-the-form-field/ */ function add_shortcode_to_label( $field, $form_data ) { // Check that the form ID is 1055 and the field id is 4 if ( 1055 === absint( $form_data[…Continue reading

Creating a Smart Tag from an ACF Field

/** * Register the Smart Tag so it will be available to select in the form builder. * * @link https://wpforms.com/developers/how-to-create-a-smart-tag-from-an-acf-field/ */ function wpf_dev_register_smarttag( $tags ) { // Key is the tag, item is the tag name. $tags[ ‘portfolio_price’ ]…Continue reading

Merging Multiple WPForms Field Values into Post Content

/** * Merging Multiple WPForms Field Values into Post Content * * @link https://wpforms.com/developers/merging-multiple-wpforms-field-values-into-post-content */ function wpf_dev_post_submissions_process( $post_id, $fields, $form_data ) { // If form ID is 463, run code below if ( 463 !== absint( $form_data[ ‘id’ ] )…Continue reading

PHP: Backend to Handle Single Image Deletion

// Register REST routes add_action(‘rest_api_init’, function () { register_rest_route(‘wp/v2’, ‘/delete-image’, [ ‘methods’ => ‘POST’, ‘callback’ => ‘chicpinups_delete_image’, ‘permission_callback’ => function (WP_REST_Request $request) { return chicpinups_check_api_key($request); }, ]); }); // Function to delete images and update metadata if (!function_exists(‘chicpinups_delete_image’)) { function…Continue reading

Unregister widgets damore

//To get rid of the selected widgets function unregister_default_wp_widgets() { unregister_widget( ‘WP_Widget_Calendar’ ); unregister_widget( ‘WP_Widget_Archives’ ); unregister_widget( ‘WP_Widget_Categories’ ); unregister_widget( ‘WP_Widget_Recent_Posts’ ); unregister_widget( ‘WP_Widget_Recent_Comments’ ); unregister_widget( ‘WP_Widget_Tag_Cloud’ ); unregister_widget( ‘WP_Widget_Meta’ ); unregister_widget( ‘WP_Widget_Links’ ); unregister_widget( ‘WP_Widget_Pages’ ); unregister_widget( ‘WP_Widget_RSS’ );…Continue reading