/** * Change a currency symbol */ add_filter(‘woocommerce_currency_symbol’, ‘change_existing_currency_symbol’, 10, 2); function change_existing_currency_symbol( $currency_symbol, $currency ) { switch( $currency ) { case ‘مصري’: $currency_symbol = ‘جنيه’; break; } return $currency_symbol; }Continue reading
function add_updates_admin_bar_menu() { global $wp_admin_bar; $wp_admin_bar->add_menu( array( ‘id’ => ‘updates’, ‘title’ => ‘Updates’, ‘href’ => admin_url( ‘update-core.php’ ), ‘parent’ => ‘top-secondary’, ) ); } add_action( ‘wp_before_admin_bar_render’, ‘add_updates_admin_bar_menu’ );Continue reading
function replace_admin_bar_text() { global $wp_admin_bar; $wp_admin_bar->add_node(array( ‘id’ => ‘site-name’, ‘title’ => __(”), )); $wp_admin_bar->add_node(array( ‘id’ => ‘my-account’, ‘title’ => ‘👤‘, ‘href’ => get_edit_profile_url(), )); } add_action(‘wp_before_admin_bar_render’, ‘replace_admin_bar_text’, 0); function remove_wp_logo() { global $wp_admin_bar; $wp_admin_bar->remove_menu(‘wp-logo’); } add_action(‘wp_before_admin_bar_render’, ‘remove_wp_logo’, 0); function remove_comments()…Continue reading
/** * Custom shortcode to display WPForms form entries in table view. * * Basic usage: [wpforms_entries_table id=”FORMID”]. * * Possible shortcode attributes: * id (required) Form ID of which to show entries. * user User ID, or “current” to…Continue reading
/** * Set the role of users who register through the Charitable * registration form shortcode. * * @param array $values * @return array $values */ function ed_charitable_set_user_registration_role( $values ) { if ( array_key_exists( ‘role’, $values ) ) { return…Continue reading
/** * Add fields to the registration form. * * @param array $fields * @return array */ add_filter( ‘charitable_user_registration_fields’, function( $fields ) { /* Add a text field. */ $fields[‘text_field’] = [ ‘type’ => ‘text’, ‘label’ => ‘My Text Field’,…Continue reading
/** * Add additional campaign fields related to the campaign creator. * * @param array $columns The list of columns. * @return array */ function ed_charitable_add_creator_campaign_fields() { $creator_fields = array( ‘organization’ => __( ‘Campaign Creator Organization’, ‘your-namespace’ ), ‘address’ =>…Continue reading
/** * Add a custom currency called “Hours”. * * @param string[] $currencies * @return string[] $currencies */ function en_add_hours_currency( $currencies ) { $currencies[ ‘HOURS’ ] = __( ‘Hours’, ‘your-namespace’ ); return $currencies; } add_filter( ‘charitable_currencies’, ‘en_add_hours_currency’ );Continue reading