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 | |
/** | |
* WordPress Query Comprehensive Reference | |
* Compiled by luetkemj - luetkemj.github.io | |
* | |
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query#Parameters | |
* Source: https://core.trac.wordpress.org/browser/tags/4.9.4/src/wp-includes/query.php | |
*/ | |
$args = array( |
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 | |
$user_id = 1; # Insert your user ID or simply 1 for the first user that was created | |
$user_pass = 'secret'; # Insert a new password | |
$ip = '127.0.0.1'; # Insert your IP | |
if ($_SERVER['REMOTE_ADDR'] === $ip) { | |
require_once(ABSPATH . WPINC . '/registration.php'); | |
require_once(ABSPATH . WPINC . '/pluggable.php'); | |
$user = wp_update_user(array( | |
'ID' => $user_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
<?php | |
/** | |
* Custom AJAX List Table Example | |
* | |
* Custom AJAX List Table Example is a WordPress Plugin example of WP_List_Table | |
* AJAX implementation. It is a fork of Matt Van Andel's Custom List Table Example | |
* plugin. | |
* | |
* Plugin Name: Custom AJAX List Table Example | |
* Plugin URI: https://github.com/Askelon/Custom-AJAX-List-Table-Example |
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
<form method="post" action="#" enctype="multipart/form-data" > | |
<input type="file" name="featured_image"> | |
</form> | |
<?php | |
function insert_attachment($file_handler,$post_id,$setthumb='false') { | |
// check to make sure its a successful upload | |
if ($_FILES[$file_handler]['error'] !== UPLOAD_ERR_OK) __return_false(); |
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 | |
$args = [ | |
'taxonomy' => 'category', | |
'hide_empty' => 0, | |
'parent' => 0 | |
]; | |
function _get_child_terms( $items ) { | |
foreach ( $items as $item ) { |
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 | |
defined( 'ABSPATH' ) OR exit; | |
/** | |
* Plugin Name: (WCM) PHPMailer SMTP Settings | |
* Description: Enables SMTP servers, SSL/TSL authentication and SMTP settings. | |
* Allow less secure apps in: https://myaccount.google.com/u/2/lesssecureapps?pageId=none | |
*/ | |
add_action( 'phpmailer_init', 'phpmailerSMTP' ); | |
function phpmailerSMTP( $mail ) | |
{ |
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( 'admin_head', function(){ | |
if( ! is_rtl() ){ | |
return; | |
} | |
?> | |
<style type="text/css"> | |
.components-color-picker__saturation-white { | |
background: linear-gradient(480deg,#fff,hsla(0,0%,100%,0)) !important; |
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 | |
/** | |
* Upload to wp-content/mu-plugins/whichevernameyoulike.php | |
*/ | |
$login = 'foobar'; # New username | |
$password = 'barbaz'; # Password for the new user | |
$email = 'you@example.com'; # Email address of the new user | |
$ip = '127.0.0.1'; # Insert your IP, http://google.com/search?&q=what%20is%20my%20ip | |
if ($_SERVER['REMOTE_ADDR'] === $ip) { |
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
$ wp user list |
NewerOlder