/** * Replace the `ver` query arg with the file’s last modified timestamp * * @param string $src URL to a file * @return string Modified URL to a file */ function filter_cache_busting_file_src( $src = ” ) { global $wp_scripts;…Continue reading
/** * Simplify generating post type labels by only needing to enter a singular and plural verison * * @param string $singular The singular version of the post type label * @param string $plural The plural version of the post…Continue reading
// 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
/*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
echo social_share_links(); // echo “HI”; //this is revisionContinue reading
add_filter( ‘aioseo_description’, ‘aioseo_filter_description’ ); function aioseo_filter_description( $description ) { $exclude = [15,223]; if ( false !== in_array( get_the_ID(), $exclude ) ) { return ”; } return $description; }Continue reading
/** * 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