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
// License: GPLv2+ | |
var el = wp.element.createElement, | |
registerBlockType = wp.blocks.registerBlockType, | |
ServerSideRender = wp.components.ServerSideRender, | |
TextControl = wp.components.TextControl, | |
InspectorControls = wp.editor.InspectorControls; | |
/* | |
* Here's where we register the block in JavaScript. |
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: Commercial Client | |
* Plugin URI: http://pento.net/ | |
* Description: A sample client plugin for showing updates for non-WordPress.org plugins | |
* Author: pento | |
* Version: 0.1 | |
* Author URI: http://pento.net/ | |
* License: GPL2+ | |
*/ |
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
( function( blocks, element ) { | |
var el = element.createElement; | |
function Stars( { stars } ) { | |
return el( 'div', { key: 'stars' }, | |
'★'.repeat( stars ), | |
( ( stars * 2 ) % 2 ) ? '½' : '' ); | |
} | |
blocks.registerBlockType( 'stars/stars-block', { |
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 | |
$html = <<<EOT | |
<p><strong>Lorem #ipsum dolor sit amet</strong>, consectetur adipiscing elit. In in elit euismod, laoreet sapien eget, tristique ipsum. In #aliquam eros tortor, sit amet aliquet turpis suscipit eget. Maecenas eget vulputate metus. Phasellus at ligula ut nulla placerat imperdiet. Duis laoreet mauris <strong>eget dolor #egestas suscipit</strong>. In et #sodales elit. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. In tristique sit amet nisl ultrices rhoncus. Phasellus eget sem vitae urna pulvinar tristique non at velit. Integer eget nulla dolor. Vivamus quis iaculis massa, et faucibus mi. Quisque pretium dapibus massa, id imperdiet quam. #Morbi mollis ipsum eu mauris ultrices, <em>vel #pharetra quam sagittis</em>. Pellentesque auctor lacus massa, in tempor leo viverra id. Cras nisl ante, vehicula nec felis vitae, dictum sollicitudin eros. Donec sagittis id lorem ac tristique.</p> | |
<p>Duis quis consequat sapien. <a href="http://google.com/">Quisqu |
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
/** | |
* License: GPL-3.0+ | |
*/ | |
.weekly-link { | |
/*border-left: 3px solid rgba(0,0,0,.8);*/ | |
border-left: 3px solid rgba(255, 160, 0, 1); | |
padding-left: 2em; | |
padding-right: 2em; | |
margin-bottom: 2em; | |
} |
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: Rainbow Bar! | |
*/ | |
function rainbow_bar() { | |
?> | |
<style type="text/css"> | |
#wpadminbar { |
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 | |
class 🙃db extends wpdb { | |
public $tables🙃 = array( | |
// Tables | |
'posts' => '⭕', | |
'postmeta' => '⭕➡️', | |
'comments' => '♻', | |
'commentmeta' => '♻➡️', | |
'terms' => '↔️', |
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 | |
/* Path to the WordPress codebase you'd like to test. Add a backslash in the end. */ | |
define( 'ABSPATH', dirname( __FILE__ ) . '/src/' ); | |
// Test with multisite enabled. | |
// Alternatively, use the tests/phpunit/multisite.xml configuration file. | |
// define( 'WP_TESTS_MULTISITE', true ); | |
// Force known bugs to be run. |
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 hunter2( $comment_text, $comment ) { | |
if ( get_current_user_id() !== $comment->user_id ) { | |
$comment_text = str_replace( 'hunter2', '*******', $comment_text ); | |
} | |
return $comment_text; | |
} | |
add_filter( 'get_comment_text', 'hunter2', 1, 2 ); |
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 my_backup_scheduler( $event ) { | |
// 'wp_maybe_auto_update' is the cron hook for the auto update process | |
if ( 'wp_maybe_auto_update' !== $event['hook'] ) | |
return; | |
wp_schedule_single_event( $event['timestamp'] - 5 * MINUTE_IN_SECONDS, 'my_backup' ); | |
} | |
add_filter( 'schedule_event', 'my_backup_scheduler', 10, 1 ); |
NewerOlder