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
const { domReady } = wp; | |
const { useMemo } = wp.element; | |
const { TextControl } = wp.components; | |
const { select, useSelect, useDispatch } = wp.data; | |
const { PluginDocumentSettingPanel } = wp.editPost; | |
const { registerPlugin } = wp.plugins; | |
const { __ } = wp.i18n; | |
/** | |
* Output the Meta panel for Report pages. |
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 | |
/** | |
* Sample code to demonstrate the issue with wp_kses and allowed_html for sanitizing svg's that contain attributes with numbers at the end. | |
*/ | |
$svg = <<<SVG | |
<svg> | |
<path x1="10" y1="10"/> | |
</svg> | |
SVG; |
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
#!/bin/bash | |
NOW=$(date +%Y-%m-%d-%H-%M-%S) | |
SQL_FILE=${NOW}_db.sql | |
# Backup database | |
/usr/local/bin/wp db export ../backups/$SQL_FILE --add-drop-table | |
# Compress the database file | |
gzip ../backups/$SQL_FILE |
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_filter( 'bd_delete_attachment_excluded_attachment_ids', 'prefix_exclude_attachment_ids_from_deletion' ); | |
function prefix_exclude_attachment_ids_from_deletion( $attachment_ids ) { | |
return array( | |
100, | |
111, | |
112, | |
); | |
} |
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 | |
function wpel_change_email_log_user_role( $capability ) { | |
return 'manage_options' // change this to the capability that you want. | |
} | |
add_filter( 'el_view_email_log_capability', 'wpel_change_email_log_user_role' ); |
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 | |
/** | |
* Plugin Name: Dump Taxonomy | |
* Plugin URI: http://bulkwp.com | |
* Description: Dump all Taxonomy for debugging | |
* Version: 0.1 | |
* License: GPL | |
* Author: Sudar | |
* Author URI: http://sudarmuthu.com/ | |
*/ |
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 | |
/** | |
* Is the current page the last page of the multi-page post. | |
* | |
* @return bool True if last page, False otherwise. | |
*/ | |
function is_last_page() { | |
global $page, $numpages, $multipage; | |
if ( $multipage ) { |
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 | |
/** | |
* Display an error message at the top of the post edit screen explaining that ratings is required. | |
* | |
* Doing this prevents users from getting confused when their new posts aren't published, as we | |
* require a valid rating custom taxonomy. | |
* | |
* @param WP_Post The current post object. | |
*/ | |
function show_required_field_error_msg( $post ) { |
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
config.vm.provider "virtualbox" do |v| | |
v.memory = 2048 | |
end |
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
$ v up | |
Bringing machine 'default' up with 'virtualbox' provider... | |
==> default: Clearing any previously set forwarded ports... | |
==> default: Fixed port collision for 22 => 2222. Now on port 2201. | |
==> default: Clearing any previously set network interfaces... | |
==> default: Preparing network interfaces based on configuration... | |
default: Adapter 1: nat | |
default: Adapter 2: hostonly | |
==> default: Forwarding ports... | |
default: 22 => 2201 (adapter 1) |
NewerOlder