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 | |
// wp-settings.php:118 | |
// Initialize multisite if enabled. | |
if ( is_multisite() ) { | |
require( ABSPATH . WPINC . '/class-wp-site-query.php' ); | |
require( ABSPATH . WPINC . '/class-wp-network-query.php' ); | |
require( ABSPATH . WPINC . '/ms-blogs.php' ); | |
require( ABSPATH . WPINC . '/ms-settings.php' ); | |
} elseif ( ! defined( 'MULTISITE' ) ) { |
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
$.ajax({ | |
url: 'ajax.php', // WP root install file: ajax.php | |
data: { | |
action: 'my_action', | |
variable: 'my_variable', | |
fastajax: { | |
empty: false, // Load Empty Shortinit? true | false. Default: false | |
mu_plugins: false, // Load MU Plugins? true | false. Default: false | |
plugins: false, // Load Plugins? true | false. Default: false | |
theme: false, // Load Theme? true | false. Default: 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 | |
// Init | |
// ----------------------------------------------------------------------- | |
define('DOING_AJAX', true); | |
define('SHORTINIT', true); | |
// WP Load | |
// ----------------------------------------------------------------------- | |
require('wp-load.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 | |
// File: /wp-content/themes/my_theme/includes/ajax-actions.php | |
add_action('wp_ajax_my_action', 'hwk_ajax_my_action'); | |
function hwk_ajax_my_action(){ | |
global $wpdb; | |
//$wpdb->get_results("SELECT * FROM ..."); | |
} |
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 | |
// File: ajax.php (Root WP Install) | |
// Init | |
// ----------------------------------------------------------------------- | |
define('DOING_AJAX', true); | |
define('SHORTINIT', true); | |
// WP Load | |
// ----------------------------------------------------------------------- |
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 | |
// File: /wp-content/themes/my_theme/includes/ajax-actions.php | |
add_action('wp_ajax_my_action', 'hwk_ajax_my_action'); | |
add_action('wp_ajax_nopriv_my_action', 'hwk_ajax_my_action'); | |
function hwk_ajax_my_action(){ | |
// is_user_logged_in() | |
// current_user_can() | |
// get_userdata() |
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
$.ajax({ | |
url: 'ajax.php', // WP root install file: ajax.php | |
data: { | |
action: 'my_action', | |
variable: 'my_variable' | |
}, | |
type: 'post', | |
success: function(response){ | |
console.log(response); | |
} |
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 | |
// File: ajax.php (Root WP Install) | |
// Init | |
// ----------------------------------------------------------------------- | |
define('DOING_AJAX', true); | |
define('SHORTINIT', true); | |
// WP Load & Requirements | |
// ----------------------------------------------------------------------- |
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 | |
ini_set('memory_limit', '-1'); | |
ini_set('display_errors', 1); | |
ini_set('display_startup_errors', 1); | |
error_reporting(E_ALL); | |
require_once('../wp-load.php'); | |
// Vérification de l'utilisateur | |
if(!current_user_can('administrator')) |
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 | |
remove_action('welcome_panel', 'wp_welcome_panel'); | |
add_action('admin_footer', 'hwk_admin_welcome_panel'); | |
function hwk_admin_welcome_panel(){ | |
if(get_current_screen()->base !== 'dashboard') | |
return; | |
$favicon = false; | |
if($favicon = get_option('site_icon', false)) |