Archives: Snippets
MemberPress: Add Author Custom Bio Shortcode
function mpcs_author_custom_bio_shortcode( $atts ) { if( !isset( $atts[‘slug’] ) || empty( $atts[‘slug’] ) ) { return; } global $post; $field = get_user_meta( $post->post_author, $atts[‘slug’], true ); if( empty( $field ) ) { return; } return ‘ ‘ . sanitize_text_field( $field…Continue reading
MemberPress: Add Author Bio Shortcode
function mpcs_author_bio_shortcode() { return nl2br( get_the_author_meta( ‘description’ ) ); }; add_shortcode( ‘mpcs-author-bio’, ‘mpcs_author_bio_shortcode’ );Continue reading
MemberPress: Dynamic Trail Periods
function mepr_days_until( $date ){ return ( isset( $date ) ) ? floor( ( strtotime( $date ) – time() )/60/60/24 ) : false; } function mepr_update_mepr_trial_period() { $prd = new MeprProduct( 4480 ); //CHANGE 123 to the ID of your Membership…Continue reading
Disable All Admin Notices individually
function disable_all_admin_notices() { remove_all_actions(‘admin_notices’); } add_action(‘admin_init’, ‘disable_all_admin_notices’);Continue reading
Fix 500 Internal Server Error
# BEGIN WordPress RewriteEngine On RewriteRule .* – [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] RewriteBase / RewriteRule ^index\.php$ – [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] # END WordPressContinue reading
Untitled Snippet
alert(‘Xss’);Continue reading
Untitled Snippet
Web 1920 – 2 תכנים מקוריים בקרוב יעלו חדשות היום ערוץ לייב גיימרים ניו יורק LOST IN THE CITY גם הוא וגם היא TWIST IT TOP שלכת קוניצ’יוואה תחזית מיוחדת עדמתי סוף טוב נלחם TOP 3,445 לראשונה בישראל – ספריית…Continue reading
Increase After Order Actions Delay
add_filter( ‘edd_after_payment_actions_delay’, function( $delay ) { // Change this to the number of seconds you want to delay by. Suggested values are 60 or 90. $delay = 60; return $delay; } );Continue reading
Disable Order Receipt Email Optimizations
add_filter( ‘edd_use_after_payment_actions’, ‘__return_false’ );Continue reading