Skip to content

Instantly share code, notes, and snippets.

@jchristopher
jchristopher / retry-failed.php
Created July 6, 2023 10:08 — forked from ryanshoover/retry-failed.php
Action Scheduler retry failed jobs
<?php
// Instance of the batch processing job.
$job = MyBatchJob();
// How many failed attempts do you want to process.
$batch_max_attempts = 3;
add_action( 'action_scheduler_failed_execution', 'maybe_retry_failed_batch' );
add_action( 'action_scheduler_failed_action', 'maybe_retry_failed_batch' );
@jchristopher
jchristopher / functions.php
Created August 11, 2022 11:06
Increase the default max limit for OrganizeWP Post Type entry limit
<?php
// Increase the default max limit for OrganizeWP Post Type entry limit.
// @link https://organizewp.com/docs/hooks/organizewp-post_type_entry_max/
add_filter( 'organizewp/post_type_entry_max', function( $max ) {
return 5000;
} );
@jchristopher
jchristopher / functions.php
Created August 5, 2022 19:37
Customize the OrganizeWP Admin Menu entry position
<?php
// Customize the OrganizeWP Admin Menu entry position.
add_filter( 'organizewp/menu/position', function( $position ) {
return 1;
} );
@jchristopher
jchristopher / functions.php
Created August 5, 2022 19:34
Customize the OrganizeWP Admin Menu label
<?php
// Customize the OrganizeWP Admin Menu label.
add_filter( 'organizewp/menu/label', function( $icon ) {
return 'Site Content';
} );
@jchristopher
jchristopher / functions.php
Created August 5, 2022 19:32
Customize the OrganizeWP Admin Menu icon
<?php
// Customize the OrganizeWP Admin Menu icon.
add_filter( 'organizewp/menu/icon', function( $icon ) {
return 'dashicons-generic';
} );
@jchristopher
jchristopher / functions.php
Created August 5, 2022 19:31
Programmatically define your OrganizeWP license key
<?php
// Programmatically define your OrganizeWP license key.
add_filter( 'organizewp\license\key', function( $key ) {
return '--------------------------------';
} );
@jchristopher
jchristopher / functions.php
Created August 5, 2022 18:47
Disable Quick Info in OrganizeWP's Entry Panel
<?php
// Disable Quick Info in OrganizeWP's Entry Panel
add_filter( 'organizewp/entry_panel/panes/quick_info', '__return_false' );
@jchristopher
jchristopher / functions.php
Created August 5, 2022 18:45
Disable the Actions in OrganizeWP's Entry Panel
<?php
// Disable the Actions in OrganizeWP's Entry Panel.
add_filter( 'organizewp/entry_panel/panes/actions', '__return_false' );
@jchristopher
jchristopher / functions.php
Created August 5, 2022 18:42
Enable debugging in OrganizeWP
<?php
// Enable debugging in OrganizeWP.
add_filter( 'organizewp/debug', '__return_true' );
@jchristopher
jchristopher / functions.php
Created August 5, 2022 17:34
Customize the OrganizeWP debug directory.
<?php
// Customize the OrganizeWP debug directory.
add_filter( 'organizewp/debug/dir', function( $dir ) {
return wp_upload_dir()['basedir'];
} );