This file contains hidden or 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 | |
| // список плагинов для установки | |
| $pluginsList = [ | |
| 'contact-form-7', | |
| 'cyr2lat', | |
| 'flamingo', | |
| 'wp-fastest-cache', | |
| 'wordpress-seo' |
This file contains hidden or 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
| const requestURL = 'https://jsonplaceholder.typicode.com/users' | |
| function sendRequest(method, url, body = null) { | |
| const headers = { | |
| 'Content-Type': 'application/json' | |
| } | |
| return fetch(url, { | |
| method: method, | |
| body: JSON.stringify(body), |
This file contains hidden or 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 | |
| add_action( 'wp_ajax_ajaxcomments', 'ugwps_submit_ajax_comment' ); // wp_ajax_{action} for registered user | |
| add_action( 'wp_ajax_nopriv_ajaxcomments', 'ugwps_submit_ajax_comment' ); // wp_ajax_nopriv_{action} for not registered users | |
| function ugwps_submit_ajax_comment(){ | |
| $comment = wp_handle_comment_submission( wp_unslash( $_POST ) ); | |
| if ( is_wp_error( $comment ) ) { | |
| $error_data = intval( $comment->get_error_data() ); | |
| if ( ! empty( $error_data ) ) { | |
| wp_die( '<p>' . $comment->get_error_message() . '</p>', __( 'Comment Submission Failure' ), array( 'response' => $error_data, 'back_link' => true ) ); |
This file contains hidden or 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 | |
| /** | |
| * Adding the Open Graph in the Language Attributes | |
| * @param $output | |
| * | |
| * @return string | |
| */ | |
| function mysite_add_opengraph_doctype( $output ) { | |
| return $output . ' xmlns:og="http://opengraphprotocol.org/schema/" xmlns:fb="http://www.facebook.com/2008/fbml"'; | |
| } |
This file contains hidden or 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 if( ! defined( 'ABSPATH' ) ) { die(); } | |
| /** | |
| * Plugin Name: Disable Attachment Pages | |
| * Plugin URI: https://gschoppe.com/wordpress/disable-attachment-pages | |
| * Description: Completely disable attachment pages the right way. No forced redirects or 404s, no reserved slugs. | |
| * Author: Greg Schoppe | |
| * Author URI: https://gschoppe.com/ | |
| * Version: 1.0.0 | |
| **/ |