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
| UPDATE wp_posts SET post_content = replace(post_content, 'http://old.url', 'http://new.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
| /* Hack para anchors con el header sticky */ | |
| :target::before { | |
| content: ""; | |
| display: block; | |
| height: 120px; | |
| margin: -120px 0 0; | |
| } |
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
| https://machetewp.com/ |
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
| /* actions fired when listing/adding/editing posts or pages */ | |
| /* admin_head-(hookname) to head include */ | |
| /* admin_footer-(hookname) to footer include */ | |
| add_action( 'admin_head-post.php', 'admin_head_post_editing' ); | |
| add_action( 'admin_head-post-new.php', 'admin_head_post_new' ); | |
| add_action( 'admin_head-edit.php', 'admin_head_post_listing' ); | |
| function admin_head_post_editing() { | |
| echo 'you are editing a post'; | |
| } |
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 | |
| wp_dropdown_categories( array( | |
| 'taxonomy' => 'category', | |
| 'multiple' => true, | |
| 'walker' => new Willy_Walker_CategoryDropdown(), | |
| 'selected' => array( 10, 12 ), // selected terms… | |
| 'hide_empty' => false, | |
| ) ); |
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
| // remove excerpt panel | |
| wp.data.dispatch( 'core/edit-post').removeEditorPanel( 'post-excerpt' ); | |
| Here is an (incomplete) list of panel IDs: | |
| taxonomy-panel-category - Category panel. | |
| taxonomy-panel-CUSTOM-TAXONOMY-NAME - Custom taxonomy panel. If your taxonomy is topic, then taxonomy-panel-topic works. | |
| taxonomy-panel-post_tag - Tags panel | |
| featured-image - Featured image panel. | |
| post-link - Permalink panel. | |
| page-attributes - Page attributes panel. |
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 | |
| //index.php | |
| $screen_shot_image = ''; | |
| if(isset($_POST["screen_shot"])) | |
| { | |
| $url = $_POST["url"]; | |
| $screen_shot_json_data = file_get_contents("https://www.googleapis.com/pagespeedonline/v2/runPagespeed?url=$url&screenshot=true"); |
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
| wp scaffold block <slug-block> --title="<title-block>" --category=<category> --theme |
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_action('wp_print_scripts', function (){ | |
| if( !in_array( $GLOBALS[ 'pagenow' ], array( 'wp-login.php', 'OTHER PAGES WITHOUT INVISIBLE RECAPTCHA' ), true ) ){ | |
| wp_dequeue_script( 'google-invisible-recaptcha' ); | |
| } | |
| }); |
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
| /* Desahbilitar jquery migrate */ | |
| function montanera_remove_jquery_migrate( &$scripts ) { | |
| if( !is_admin() ) { | |
| $scripts->remove( 'jquery' ); | |
| $scripts->add( 'jquery', false, array( 'jquery-core' ), '1.12.4' ); | |
| } | |
| } | |
| add_filter( 'wp_default_scripts', 'montanera_remove_jquery_migrate' ); |