I hereby claim:
- I am timwhitlock on github.
- I am timwhitlock (https://keybase.io/timwhitlock) on keybase.
- I have a public key ASAqRSGF2gFgfMTquG-FBo71hJ229f0ZOlYS8-SbbTp-8Qo
To claim this, I am signing this object:
<?php | |
/** | |
* Plugin Name: Disable POSTing to REST API | |
* Version: 0 | |
*/ | |
add_filter( 'rest_authentication_errors', function( $access = null ){ | |
if( 'GET' !== $_SERVER['REQUEST_METHOD'] ){ | |
return new WP_Error( 'rest_cannot_access', 'Nope', array( 'status' => 405 ) ); | |
} |
<?php | |
/** | |
* Plugin Name: Disable REST API | |
* Version: 0 | |
*/ | |
// completely disable wp-json access | |
add_filter( 'rest_authentication_errors', function( $access ){ | |
return new WP_Error( 'rest_cannot_access', 'Bye', array( 'status' => 403 ) ); | |
} ); |
I hereby claim:
To claim this, I am signing this object:
<?php | |
/** | |
* MU plugins inside directories are not returned in `get_mu_plugins`. | |
* This filter modifies the array obtained from Wordpress when Loco grabs it. | |
* | |
* Note that this filter only runs once per script execution, because the value is cached. | |
* Define the function *before* Loco Translate plugin is even included by WP. | |
*/ | |
function add_unregistered_plugins_to_loco( array $plugins ){ |
#!/bin/bash | |
# Actually just strips carriage returns | |
cp -p "$1" "$1.dos" | |
tr -d '\r' < "$1.dos" > "$1" | |
rm -f "$1.dos" |
<?php | |
/** | |
* A warning to myself that custom iterators cannot entirely masquerade as native arrays for legacy code compatibility: | |
* | |
* - Custom classes implementing the Iterator interface work with `foreach`, but not with native array pointer functions. | |
* - Built-in iterators do work with `current`, `key` and `next` but the iterator methods cannot be overridden in subclasses. | |
*/ | |
/** |
<?php | |
/** | |
* display warning in Wordpress admin that WPLANG constant will be ignored | |
*/ | |
is_admin() and add_action( 'admin_notices', function(){ | |
if( defined('WPLANG') && WPLANG && 3 < (int) $GLOBALS['wp_version'] ){ | |
echo '<div class="error"><p><strong>Warning</strong> <code>WPLANG</code> is deprecated and should be removed from wp-config.php</p></div>'; | |
} | |
} ); |
<?php | |
namespace my\TestBundle\Assetic; | |
use Assetic\Factory\LazyAssetManager; | |
/** | |
* Overridden asset manager that exposes source maps referenced in CSS and JS | |
*/ | |
class AssetManager extends LazyAssetManager { |
<?php | |
/* wp-config.php */ | |
/* use mysqli driver, WP>=3.9 */ | |
define('WP_USE_EXT_MYSQL', false ); |
<?php | |
use Guzzle\Http\Message\Response; | |
use Guzzle\Plugin\Mock\MockPlugin; | |
use Guzzle\Service\Client; | |
use Guzzle\Service\Description\ServiceDescription; | |
use Guzzle\Service\Resource\Model; | |
use Guzzle\Tests\GuzzleTestCase; | |
/** |