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 | |
https://wordpress.stackexchange.com/questions/299629/why-does-wp-redirect-strip-out-0a-url-encoded-new-line-character-and-how-do-i | |
if ( !function_exists('wp_redirect') ) : | |
/** | |
* Redirects to another page. | |
* | |
* Note: wp_redirect() does not exit automatically, and should almost always be | |
* followed by a call to `exit;`: | |
* |
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 | |
$url = 'http://www.subdomain1.subdomain2.subdomain3.maindomain.co.uk/asdasdsad/?asdsad=0&asdad=1&sadsa=2'; | |
pretty_debug( op_get_domain( $url ) ); | |
/** | |
* Return main domain from URL | |
* | |
* @param string $url URL to extract from. | |
* @return mixed Domain | 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 | |
add_action( 'wp_loaded', 'export_acf_fields' ); | |
/** | |
* Export ACF fields to json. | |
* | |
* The "acf-json" folder must exists within your theme. | |
* | |
* @return void |
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 | |
/** | |
* Custom rewrite for ACF get_field() with support for returning a default value. | |
* | |
* @param string $field_name ACF Field name. | |
* @param string $default Default value to return if empty setting. | |
* @param mixed $post_id The post_id of which the value is saved against. | |
* @param boolean $format_value Whether or not to format the value. | |
* @return string ACF field value or default. | |
*/ |
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
# UPDATE ADMIN EMAIL FOR SUB-SITES | |
wp site list --field=blog_id | \ | |
xargs -n1 -I {} sh -c '\ | |
if [ "1" != {} ]; then \ | |
echo "Blog ID: {}" && \ | |
wp db query '\''UPDATE wp_{}_options SET option_value="admin@domain.com" WHERE option_name="admin_email"'\'' --skip-column-names | |
fi \ | |
' | |
# DISPLAY ADMIN EMAIL |
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 | |
/** | |
* Check if post type uses classic editor. | |
* Used for adding tinyMCE buttons | |
* | |
* @return boolean | |
*/ | |
public static function post_type_uses_classic_editor() { | |
$screen = get_current_screen(); | |
if ( empty( $screen ) ) { |
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
<?xml version="1.0"?> | |
<ruleset name="10up PHPCS"> | |
<description>10up PHPCS extended.</description> | |
<rule ref="10up-Default" /> | |
<exclude-pattern>/vendor/</exclude-pattern> | |
<exclude-pattern>/dist/</exclude-pattern> | |
<exclude-pattern>/wordpress-fieldmanager/</exclude-pattern> | |
<config name="testVersion" value="7.3-"/> |
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
<?xml version="1.0" encoding="UTF-8" ?> | |
<!-- This is a WordPress eXtended RSS file generated by WordPress as an export of your site. --> | |
<!-- It contains information about your site's posts, pages, comments, categories, and other content. --> | |
<!-- You may use this file to transfer that content from one site to another. --> | |
<!-- This file is not intended to serve as a complete backup of your site. --> | |
<!-- To import this information into a WordPress site follow these steps: --> | |
<!-- 1. Log in to that site as an administrator. --> | |
<!-- 2. Go to Tools: Import in the WordPress admin panel. --> | |
<!-- 3. Install the "WordPress" importer from the list. --> |
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
phpcs --standard=tests/build/phpcs.xml --report=summary . | |
PHP CODE SNIFFER REPORT SUMMARY | |
-------------------------------------------------------------------------------- | |
FILE ERRORS WARNINGS | |
-------------------------------------------------------------------------------- | |
/usr/local/zend/apache2/htdocs/project/application/Bootstrap.php 1 4 | |
...2/htdocs/Project/application/controllers/ActivityController.php 3 1 | |
... |
OlderNewer