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 { registerPlugin } = wp.plugins; | |
const { PluginDocumentSettingPanel } = wp.editPost; | |
const PANEL_NAME = 'my-panel'; | |
const Render = () => ( | |
<PluginDocumentSettingPanel | |
name="custom-setting-panel" | |
title="Custom Panels" | |
className="custom-panel" |
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 | |
register_post_meta( 'page', 'sidebar_plugin_meta_block_field', [ | |
'show_in_rest' => [ | |
'prepare_callback' => __NAMESPACE__ . '\\prevent_meta_exposition' | |
], | |
'single' => true, | |
'type' => 'string', | |
'sanitize_callback' => 'sanitize_text_field', | |
] ); |
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 | |
function convert( $number ) { | |
if ( $number > 0 ) { | |
return $number * 2; | |
} | |
return $number / 2; | |
} |
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 | |
function answer() { | |
return '42'; | |
} |
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 postId = 1000; | |
const frames = {}; | |
/** | |
* Get a Media Modal instance for a given item ID | |
* | |
* @param itemId | |
* @return {object} | |
*/ | |
function getMediaFrame( itemId ) { |
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
#!/usr/bin/env bash | |
# Change this! | |
PATH_TO_RULESETS="~/source" | |
echo "Select what type of review you want to make: Security(s)/All(a). Default Security" | |
read SUFFIX | |
if [[ -z "$SUFFIX" ]] | |
then | |
SUFFIX='s' |
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
<?xml version="1.0"?> | |
<ruleset name="My-Project"> | |
<description>Sniffs for the coding standards of your project.</description> | |
<file>.</file> | |
<!-- Exclude the Composer Vendor directory. --> | |
<exclude-pattern>/vendor/*</exclude-pattern> | |
<!-- Exclude the Node Modules directory. --> |
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
<?xml version="1.0"?> | |
<ruleset name="Ignacio"> | |
<description>Security reviews with PHPCS.</description> | |
<file>.</file> | |
<!-- Exclude the Composer Vendor directory. --> | |
<exclude-pattern>/vendor/*</exclude-pattern> | |
<!-- Exclude the Node Modules directory. --> |