widgets ,shortcodes and Gutenberg blocks.
Version: 2.2.0
Author: Paul Bearne
Text Domain: author-avatars
License: GPLv2 or later
Domain Path: /translations
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
// The current version of the author avatars plugin. Needs to be updated every time we do a version step.
define( 'AUTHOR_AVATARS_VERSION', '2.2.0' );
// List of all version that need an upgrade, used during update check. (Append new version to the end and write an update__10_11 method on AuthorAvatars class if needed)
define( 'AUTHOR_AVATARS_VERSION_HISTORY', serialize( array(
'0.1',
'0.2',
'0.6.2',
'0.7',
) ) );
require_once( 'lib/AuthorAvatars.class.php' );
$aa = new AuthorAvatars();
// can't add this in the class as it not found
add_action( 'wp_ajax_AA_shortcode_paging', 'AA_shortcode_paging' );
add_action( 'wp_ajax_nopriv_AA_shortcode_paging', 'AA_shortcode_paging' );
function AA_shortcode_paging() {
$params = wp_unslash( $_POST );
$nonce = isset( $params['postCommentNonce'] ) ? $params['postCommentNonce'] : '';
// check to see if the submitted nonce matches with the
// generated nonce we created earlier
if ( ! wp_verify_nonce( $nonce, 'author-avatars-shortcode-paging-nonce-' . AA_get_shortcode_hash( $params ) ) ) {
die( 'Busted!' );
}
// need to create class in the function scope
$aaa = new AuthorAvatars();
$aaa->init_shortcodes();
echo $aaa->author_avatars_shortcode->shortcode_handler( $_POST, null, true ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
die();
}
add_filter( 'plugin_action_links_' . plugin_basename( __FILE__ ), 'AA_add_action_links' );
function AA_add_action_links( $links ) {
$mylinks = array(
sprintf( '%s',
esc_url( 'https://translate.wordpress.org/projects/wp-plugins/author-avatars' ),
__( 'Help translate.', 'author-avatars' )
)
);
return array_merge( $links, $mylinks );
}
/**
* Block Initializer.
*/
require_once plugin_dir_path( __FILE__ ) . 'blocks/src/init.php';
//function edit_contactmethods( $contactmethods ) {
// $contactmethods['facebook'] = 'Facebook';
// $contactmethods['twitter'] = 'Twitter';
//// unset($contactmethods['yim']);
//// unset($contactmethods['aim']);
//// unset($contactmethods['jabber']);
// return $contactmethods; }
//
//add_filter( 'user_contactmethods','edit_contactmethods', 10, 1 );
//function aa_user_raw_list( $users ){
// $filtered_users = array();
// foreach ( $users as $user ) {
// $user_status = get_user_meta( $user->user_id, 'pw_user_status', true );
// if ( 'denied' !== $user_status ) {
// $filtered_users[] = $user;
// }
// }
//
// return $filtered_users;
//}
//
//
//add_filter( 'aa_user_raw_list','aa_user_raw_list' );