Category: Admin
How to Conditionally Show the Next Button on a Specific Page
/** * Hide Next button on page 2 by default and show it once an option in a field (e.g. Multiple Choice) is selected. */ // Add CSS to hide the Next button on page 2. add_action( ‘wp_head’, function ()…Continue reading
Untitled Snippet
MemberPress: Add Address Column to Subscriptions Table
add_filter( ‘mepr-admin-subscriptions-cols’, function( $cols ) { $cols[‘col_address’] = __( ‘Address’, ‘memberpress’ ); return $cols; }); add_action( ‘mepr-admin-subscriptions-cell’, function( $column_name, $rec, $table, $attributes ) { if( $column_name === ‘col_address’ ) { $user = new MeprUser( ( int ) $rec->user_id ); $address_one…Continue reading
Test
cookie consent script
Cookie Consent by Free Privacy Policy Generator Update cookies preferencesContinue reading
font awesome script for headers
Use a WooCommerce Product Attribute as the Brand in Product Schema
add_filter( ‘aioseo_schema_output’, ‘aioseo_filter_schema_output’ ); function aioseo_filter_schema_output( $graph ) { if ( ! function_exists( ‘is_product’ ) || ! is_product() ) { return $graph; } foreach ( $graph as &$item ) { if ( ‘Product’ !== $item[‘@type’] ) { continue; } if…Continue reading
Javascript: React Forms
// BMI Calculator Component function BMICalculator() { const { register, handleSubmit, formState: { errors } } = ReactHookForm.useForm(); const [unit, setUnit] = React.useState(‘cm’); const [weightUnit, setWeightUnit] = React.useState(‘kg’); const handleUnitChange = (e) => { const selectedUnit = e.target.value; if (weightUnit…Continue reading
Donation Form Email Check (Advanced)
add_filter(‘charitable_validate_donation_form_submission_email_check’, ‘charitable_test_for_email’, 10, 2 ); function charitable_test_for_email( $valid, $submitted ) { $email = $submitted->get_submitted_value( ’email’ ); if ( ! is_valid_email( $email ) ) { return false; } return $valid; } function is_valid_email($email) { // Use PHP’s built-in function to split…Continue reading