PCC Selector

// https://staging-solaiscom.temp312.kinsta.cloud/product/lcs/ include constant(‘WP_PLUGIN_DIR’) . ‘/solais-pdf/fpdm/fpdm.php’; // Start the download function product_pdf_download_file() { if (isset($_GET[‘productpdf’]) && $_GET[‘productpdf’] = ‘download’) { $post_id = get_early_postid(); $product_sheet_url = get_product_sheet_url($post_id, true); $wp_content_dir = ‘/wp-content/’; if (!empty($product_sheet_url) && stripos($product_sheet_url, $wp_content_dir) !== false) { $pdf_template =…Continue reading

custom_python_plugin

/*running python script in wordpress environment*/ function run_python_script($script_name) { $output = exec(‘python ‘ . plugin_dir_path(__FILE__) . ‘python-scripts/’ . $script_name); return $output; } add_shortcode( ‘run_python’, ‘run_python_shortcode’ ); function run_python_shortcode($attributes) { $script_name = $attributes[‘script’]; $output = run_python_script($script_name); return $output; } ?>Continue reading

Add unfiltered_html to editor role

/** * Add the unfiltered_html capability to the editor role. * Be careful which users you grant this capability to. */ add_filter( ‘map_meta_cap’, function ( $caps, $cap, $user_id ) { // Change editor with the user role you want to…Continue reading

Formidable Pro – Merge Snippet

/* * WebMerge AGreements */ add_action(‘frm_after_create_entry’, ‘formidable_send_to_webmerge’, 0, 2); add_action(‘frm_after_update_entry’, ‘formidable_send_to_webmerge’, 0, 2); function formidable_send_to_webmerge($entry_id, $form_id){ if($form_id == 23){ $webmerge_url = ‘https://www.webmerge.me/route/28114/ymffng’; }elseif($form_id == 43){ $webmerge_url = ‘https://www.webmerge.me/route/28347/lmtb8i’; } else{ return; } $frm_field = new FrmField(); $fields = array(‘fields’ =>…Continue reading

getcemrow 648

$therow = htmlspecialchars($_REQUEST[‘cemrow’]); echo ‘This row is ‘.$therow.’‘; $Host = “localhost”; $User = “i9065950_wp2”; $Password = “E.SaEj4ol3IAOnlC0ur27”; $DBName = “i9065950_wp2”; $Table = “cemdata”; $cemetery = “Boscombe”; $query = “SELECT * from cemdata where iroot like ‘$therow%’ order by col ASC”;…Continue reading

Completely Disable Comments (copy)

add_action(‘admin_init’, function () { // Redirect any user trying to access comments page global $pagenow; if ($pagenow === ‘edit-comments.php’) { wp_safe_redirect(admin_url()); exit; } // Remove comments metabox from dashboard remove_meta_box(‘dashboard_recent_comments’, ‘dashboard’, ‘normal’); // Disable support for comments and trackbacks in…Continue reading