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
| // extend the Function object to include a wrap instance method | |
| Function.prototype.wrap = function( callback ) { | |
| var original = this; | |
| // Aquí arguments tiene un sólo elemento (la función anónima que se pasa a speak) | |
| console.log(arguments); | |
| return function() { | |
| // Aquí arguments tiene 23 elementos (¿Por qué?). Son 'Mary' y 'Kate' | |
| // Si estamos en una función anónima sin parámetros,¿No debería estar vacío? | |
| console.log(arguments); |
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
| jQuery(document).ready(function($) { | |
| window.CalendarPlusAdmin = { | |
| models: {}, | |
| views: {}, | |
| collections: {}, | |
| /*****************************************************************/ | |
| /** HELPERS **/ |
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 | |
| add_action( 'plugins_loaded', 'dolly_generate_css_file' ); | |
| function dolly_generate_css_file() { | |
| if ( isset( $_GET['dolly-styles'] ) && $_GET['dolly-styles'] === 'true' ) { | |
| header( 'Content-type: text/css' ); | |
| $options = get_option( 'dolly-options' ); | |
| ?> | |
| .mi-clase { | |
| background:<?php echo $options['background-color']; ?>; |
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 | |
| add_action( 'plugins_loaded', 'dolly_generate_css_file' ); | |
| function dolly_generate_css_file() { | |
| if ( isset( $_GET['dolly-styles'] ) && $_GET['dolly-styles'] === 'true' ) { | |
| // "Engañar la cabecera" | |
| // Generar aquí el CSS | |
| exit; | |
| } | |
| } |
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 | |
| add_action( 'wp_enqueue_scripts', 'dolly_load_styles' ); | |
| function dolly_load_styles() { | |
| $css_url = add_query_arg( 'dolly-styles', 'true', home_url() ); | |
| wp_enqueue_style( 'dolly-styles', $css_url ); | |
| } |
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 | |
| add_action( 'wp_head', 'dolly_print_styles' ); | |
| function dolly_print_styles() { | |
| $options = get_option( 'my-options' ); | |
| ?> | |
| <style> | |
| .my-class { | |
| background-color:<?php echo $options['background-color']; ?>; | |
| font-size:<?php echo $options['font-size']; ?>px; | |
| } |
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
| <phpunit | |
| bootstrap="tests/bootstrap.php" | |
| backupGlobals="false" | |
| colors="true" | |
| convertErrorsToExceptions="true" | |
| convertNoticesToExceptions="true" | |
| convertWarningsToExceptions="true" | |
| > | |
| <php> | |
| <const name="WP_TESTS_MULTISITE" value="1" /> |
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 | |
| add_action( 'wp_ajax_fictizia_load_posts', 'fictizia_load_posts' ); | |
| add_action( 'wp_ajax_nopriv_fictizia_load_posts', 'fictizia_load_posts' ); | |
| function fictizia_load_posts() { | |
| $posts = // SELECCIONAMOS LOS POSTS | |
| wp_send_json( $posts ); | |
| } |
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 | |
| add_action( 'admin_menu', 'fictizia_add_settings_menu' ); | |
| function fictizia_add_settings_menu() { | |
| add_submenu_page( 'fictizia-main', 'Settings', 'Settings', 'manage_options', 'fictizia-settings', 'fictizia_display_settings_menu' ); | |
| } | |
| function fictizia_settings_init() { | |
| register_setting( 'OPTIONS_GROUP', 'OPTIONS_GROUP', 'SANITIZE_CALLBACK' ); | |
| add_settings_section( 'SECTION_ID', __( 'SECTION_TITLE', 'fictizia' ), 'SECTION_CALLBACK', 'MENU_SLUG' ); |
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
| <form action="" method="POST"> | |
| <table class="form-table"> | |
| <tr> | |
| <th scope="row"><?php _e( 'New customer', 'fictizia' ); ?></th> | |
| <td> | |
| <input type="text" name="cliente" value=""/> | |
| </td> | |
| </tr> | |
| </table> |