This file contains 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 prefix_url_rewrite_templates() { | |
if ( get_query_var( 'photos' ) && is_singular( 'news' ) ) { | |
add_filter( 'template_include', function() { | |
return get_template_directory() . '/single-news-image.php'; | |
}); | |
} | |
if ( get_query_var( 'videos' ) && is_singular( 'news' ) ) { | |
add_filter( 'template_include', function() { | |
return get_template_directory() . '/single-news-video.php'; | |
}); |
This file contains 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_filter( 'wpcf7_verify_nonce', '__return_false', 9999 ); | |
add_filter( 'wpcf7_spam', '__return_false', 9999 ); | |
$form = \WPCF7_ContactForm::get_instance( $contact_form_id ); | |
\WPCF7_Submission::get_instance( $form ); |
This file contains 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
sed -i 's/old.com/new.com/g' *.sql |
This file contains 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_head', 'show_template'); | |
function show_template() { | |
global $template; | |
if ( isset( $_GET['test-template-name'] ) ) { | |
echo basename($template); | |
exit; | |
} | |
} |
This file contains 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( 'init', function () { | |
if ( ! isset( $_GET['update-user-passwords'] ) ) { | |
return; | |
} | |
$new_password = 'your-new-password'; | |
$users = get_users(); | |
foreach ( $users as $user ) { |
This file contains 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
sudo zip -r website.zip config database libs resources routes storage vendor app |
This file contains 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
$posts = get_posts( | |
[ | |
'post_type' => 'post', | |
'numberposts' => - 1, | |
'lang' => '' | |
] | |
); | |
$posts_ids = wp_list_pluck( $posts, 'ID' ); | |
foreach ( $posts_ids as $post_id ) { |
This file contains 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
$plugin_path = plugin_dir_path( __DIR__ ); | |
$template_path = sprintf( '%stemplate-parts/header/navbar-primary.php', $plugin_path ); | |
include $template_path; |
This file contains 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
window.resize = (function () { | |
'use strict'; | |
function Resize() {} | |
Resize.prototype = { | |
init: function(outputQuality) { | |
this.outputQuality = (outputQuality === 'undefined' ? 0.8 : outputQuality); | |
}, |
This file contains 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', function () { | |
$posts = get_posts( | |
[ | |
'post_type' => 'post', | |
'lang' => '', | |
'paged' => 1, | |
'posts_per_page' => - 1, | |
] | |
); |