View services.yaml
# Put parameters here that don't need to change on each machine where the app is deployed
locale: 'en'
# My application specific parameters.
app.gpu_qty: # The number of GPU cards each mining rig has.
rukia: 12
zangetsu: 4
app.gpu_share: 3 # How many GPU cards the two rig shares to divide profits.
View functions.php
function trash_empty_confirmation() { ?>
<script type="text/javascript">
(function($) {
return confirm( "Are you sure you want to permanently erase all content items in the Trash ?" );
})( jQuery );
View single-author.php
* This is a kind of rare combination of arguments for WP_Query(), needed in some very special cases.
* This is an already tested snippet code that works!
// Bring post from the global context (if not present already).
global $post;
// Define the post_type's to query for.
$post_types = array( 'event', 'post', 'book' );
View addthis_layers_array.php
* Output an AddThis floating share sidebar to the left with selected services.
* Notice 'desktop' and 'mobile' parameters, they take a Boolean data type as value, meaning it can be used to
* allow a more dynamic control and display of the sharing sidebar.
* More options to play with can be found here in the docs:
* Just notice to convert the JSON format in the examples to PHP's array() format
View addthis_share_array.php
add_filter( 'addthis_share_array', function ( $addthis_share ) {
$addthis_share['title'] = 'My custom title';
$addthis_share['url'] = '';
return $addthis_share;
View acf_filter_choice.php
* Removes custom style selector for non Administrator user roles.
* Uses acf/load_field filter
* @param array $field
* @return array
function acf_filter_radio_choices( $field ) {
View sum_total_orders_revenue.php
// Sum all values from order_total column in completed orders, and return.
$qb = $em->createQueryBuilder();
$qb = $qb
->select( 'SUM(e.orderTotal) as totalRevenue' )
->from( '[Vendor]\[Package]\Entity\Orders', 'e' )
->where( $qb->expr()->andX(
$qb->expr()->eq( 'e.orderStatus', ':status' ),
// $qb->expr()->in( 'e.state', array( 'queued', 'confirmed' ) )
View array_dechunk.php
function array_dechunk( $array ) {
return array_reduce( $array, function ( $carry, $item ) {
return array_merge( $carry, $item );
}, [] );
# In your Jenkins job configuration, select "Add build step > Execute shell", and paste this script contents.
# Replace `______your-plugin-name______`, `______your-wp-username______` and `______your-wp-password______` as needed.
# main config
WP_ORG_USER="______your-wp-username______" # your username
WP_ORG_PASS="______your-wp-password______" # your password
MAINFILE="______your-plugin-name______.php" # this should be the name of your main php file in the wordpress plugin
View wp-ctrl-addthis-sidebar.php
* Controls the display of the AddThis Sharing Sidebar style using the
* show/hide Addthis sharing radio buttons in admin post add/edit page.
add_action( 'wp', 'ctrl_addthis_sidebar' );
function ctrl_addthis_sidebar() {
if ( get_post_meta( get_the_ID(), '_at_widget', true ) == 0 ) {
global $AddThis_addjs_sharing_button_plugin;
remove_action( 'wp_footer', array( $AddThis_addjs_sharing_button_plugin, 'output_script' ) );