Duplicate Post/Page Link (copy)

// Add duplicate button to post/page list of actions. add_filter( ‘post_row_actions’, ‘wpcode_snippet_duplicate_post_link’, 10, 2 ); add_filter( ‘page_row_actions’, ‘wpcode_snippet_duplicate_post_link’, 10, 2 ); // Let’s make sure the function doesn’t already exist. if ( ! function_exists( ‘wpcode_snippet_duplicate_post_link’ ) ) { /** *…Continue reading

Advanced Spam Filters for Elementor Forms

/** START ELEMENTOR FORM SPAM PROTECTION **/ add_action( ‘elementor_pro/forms/validation’, function ( $record, $handler ) { // Make sure the form is an instance of Form_Record class if ( ! $record instanceof \ElementorPro\Modules\Forms\Classes\Form_Record ) { return; } $raw_fields = $record->get(‘fields’); $fields…Continue reading

WPForms Smart Tags – Birth Date

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

WPForms Smart Tags – Grad Year

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

WPForms Smart Tags – User Login

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

WPForms Smart Tags – Birth Date

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

TplMng

// This code is part of the template, $tplData[‘hasShellZip’] is provided through TplMng $hasShellZip = $tplData[‘hasShellZip’]; if ($hasShellZip) { esc_html_e(‘The “Shell Zip” mode allows…’, ‘duplicator-pro’); ?>Continue reading

HTML inside PHP

// ❌ The output of this function is not readable public function displayHtml() { //some logic here echo ‘ ‘; echo ‘‘; echo ‘‘; echo __(‘Some text’, ‘duplicator-pro’); echo ‘ ‘; } // ❌ This function needs to escape large…Continue reading