WP Social Ninja discovery endpoint for Astro integration final

/** * WP Social Ninja endpoints for Astro integration. * * Discovery test: * https://proxy.carfit-hamburg.de/wp-json/inkontakt/v1/wpsn/discovery/428 * * Reviews test: * https://proxy.carfit-hamburg.de/wp-json/inkontakt/v1/wpsn/reviews/428 * * Requires authenticated WordPress Application Password request. */ add_action(‘rest_api_init’, function () { register_rest_route(‘inkontakt/v1’, ‘/wpsn/discovery/(?P[0-9]+)’, array( ‘methods’ => WP_REST_Server::READABLE,…Continue reading

Hide WP Admin Bar & Edit Page with Query String

define(‘ADMIN_BAR_SECRET’, ‘victor’); // put in wp-config.php // ==================================== // USAGE & HOW IT WORKS: // ==================================== // ?showadminbar=1 sets a cookie that persists for 1 hour so you don’t have to keep appending the query string on every page. //…Continue reading

Forms | Business email validation (on submit)

add_filter( ‘gform_validation’, function( $result ) { $blocked = [ ‘gmail.com’,’googlemail.com’,’yahoo.com’,’ymail.com’,’rocketmail.com’, ‘hotmail.com’,’outlook.com’,’live.com’,’msn.com’, ‘icloud.com’,’me.com’,’mac.com’, ‘aol.com’,’aim.com’, ‘proton.me’,’protonmail.com’, ‘yandex.com’,’mail.com’,’zoho.com’,’gmx.com’,’fastmail.com’,’yumobiz.com’ ]; $form = $result[‘form’]; $is_valid = $result[‘is_valid’]; // keep GF’s existing validation state foreach ( $form[‘fields’] as &$field ) { $is_email = ( $field->type ===…Continue reading

Home page

add_action(‘wp_head’, ‘ggs_homepage_schema_1901’, 20); function ggs_homepage_schema_1901() { if (!is_page(1901)) { return; } $schema = [ ‘@context’ => ‘https://schema.org’, ‘@graph’ => [ [ ‘@type’ => ‘ProfessionalService’, ‘@id’ => ‘https://goodguysseo.com/#organization’, ‘name’ => ‘Good Guys SEO’, ‘url’ => ‘https://goodguysseo.com/’, ‘telephone’ => ‘+1-917-402-3438′, ’email’ =>…Continue reading