This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // See: wp-includes/js/api-request.js | |
| // Returns a jqXHR object. See: https://api.jquery.com/jQuery.ajax/#jqXHR | |
| wp.apiRequest({path: '/namespace/vendor/v1/config'}) | |
| .then(configOptions => console.log(configOptions)); | |
| // jqXHR object has method then(), but does not have methods catch() or | |
| // finally(). Use fail() or always() instead | |
| wp.apiRequest({path: '/namespace/vendor/v1/config'}) | |
| .done(configOptions => console.log(configOptions)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Optimize WooCommerce Scripts | |
| * Remove WooCommerce Generator tag, styles, and scripts from non WooCommerce pages. | |
| */ | |
| add_action( 'wp_enqueue_scripts', 'child_manage_woocommerce_styles', 99 ); | |
| function child_manage_woocommerce_styles() { | |
| //remove generator meta tag | |
| remove_action( 'wp_head', array( $GLOBALS['woocommerce'], 'generator' ) ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {"component":{"id":63,"name":"ct_div_block","options":{"ct_id":63,"ct_parent":9,"selector":"div_block-63-62","original":{"margin-bottom":"20","globalconditions":[{"name":"ZZOXYVSBDYNAMIC","operator":0,"value":"yes","oxycode":"[oxygen ct_sign_sha256='fbb83a7bd3dbd433361a314dc52a16df0696f59fb362194bbdb69cc1aecc03d4' data='phpfunction' function='woo_field' arguments='is_on_sale' ]"}]},"nicename":"Element Sale Countdown"},"depth":6,"children":[{"id":42,"name":"ct_code_block","options":{"ct_id":42,"ct_parent":63,"selector":"code_block-42-62","original":{"code-js":"function updateTimers() {\n \n if( window.angular ) return;\n \n var now = new Date();\n var containers = document.querySelectorAll(\".x-count\");\n \n containers.forEach(function(container) {\n var future = new Date(\n container.getAttribute(\"data-count-year\"),\n parseInt(container.getAttribute(\"data-count-mo\")) - 1, // Convertir y restar 1 al mes\n parseInt(container.getAttribute(\"data-count-day\")) + 1 // Convertir y suma |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function float2rat(x) { | |
| tolerance = 1.e-4; | |
| h1=1; h2=0; | |
| k1=0; k2=1; | |
| b = x; | |
| do { | |
| a = Math.floor(b); | |
| aux = h1; h1 = a*h1+h2; h2 = aux; | |
| aux = k1; k1 = a*k1+k2; k2 = aux; | |
| b = 1/(b-a); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function woo_field($property) { | |
| $date_format = 'd - M - Y'; //Format Date | |
| global $woocommerce, $product; | |
| $product_id = $product->get_id(); | |
| $info = null; | |
| switch ($property) { | |
| case 'id': // Extracts the product ID |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /* | |
| Plugin Name: UTF8mb4-convert | |
| Version: 1.0 | |
| */ | |
| function update_db_to_utf8mb4() { | |
| if ( ! isset( $_GET['update-utf8bm4'] ) ) { | |
| return; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * WordPress Query Comprehensive Reference | |
| * Compiled by luetkemj - luetkemj.com | |
| * | |
| * CODEX: http://codex.wordpress.org/Class_Reference/WP_Query#Parameters | |
| * Source: https://core.trac.wordpress.org/browser/tags/3.9/src/wp-includes/query.php | |
| */ | |
| $args = array( | |
| //////Author Parameters - Show posts associated with certain author. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| body { | |
| --base: 20; | |
| --scale-headings: 1.44; | |
| --scale-mobile: 0.7; | |
| --scale-mobile-headings: 0.4; | |
| --scale-icons: 1.4; | |
| --min-viewport: 480; | |
| --max-viewport: 1600; | |
| --max-size: var(--base); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| add_filter( 'script_loader_tag', 'yankiara_defer_scripts', 10, 3 ); | |
| function yankiara_defer_scripts( $tag, $handle, $src ) { | |
| $defer = array( 'script-handle-1', 'script-handle-2', 'script-handle-3' ); | |
| if ( in_array( $handle, $defer ) ) | |
| return '<script src="' . $src . '" defer="defer" type="text/javascript"></script>' . "\n"; | |
| return $tag; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* I'll put here different examples of dynamic query for Oxygen repeater : | |
| * - Use one of the following repeater_dynamic_query definitions | |
| * in code block just BEFORE the repeater | |
| * - Set the repeater custom query settings : post type, number of posts, order... | |
| * - Add the remove_action in a code block AFTER the repeater | |
| */ | |
| /**************************************************************************************************** | |
| * Display related posts for any CPT with taxonomy: |
NewerOlder