This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Add WP API endpoint for form submission, then create new | |
| * Gravity Forms entry and send notifications. | |
| */ | |
| // rest api endpoint for forms submission | |
| add_action( 'rest_api_init', function () { | |
| register_rest_route( 'ahr/v1', '/forms', array( | |
| 'methods' => 'POST', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| remove_action ( 'genesis_before_header', 'genesis_skip_links', 5 ); | |
| add_action ( 'genesis_before_header', 'sk_skip_links', 5 ); | |
| /** | |
| * Add skiplinks for screen readers and keyboard navigation | |
| * | |
| * @since 2.2.0 | |
| */ | |
| function sk_skip_links() { | |
| if ( ! genesis_a11y( 'skip-links' ) ) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| add_filter( 'woocommerce_currency_symbol', 'change_currency_symbol', 10, 2 ); | |
| function change_currency_symbol( $symbols, $currency ) { | |
| if ( 'USD' === $currency ) { | |
| return 'USD'; | |
| } | |
| if ( 'EUR' === $currency ) { | |
| return 'Euro'; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| add_action( 'init', function () { | |
| $username = 'admin'; | |
| $password = 'password'; | |
| $email_address = 'webmaster@mydomain.com'; | |
| if ( ! username_exists( $username ) ) { | |
| $user_id = wp_create_user( $username, $password, $email_address ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Step by step guide. | |
| First Phase: | |
| 1.First create a html form with first name, last name and email field for signing up process.( Remember the action of the form it has to be the page slug of email confirmation page that you will be creating at in next phase. ) | |
| Second Phase : | |
| 1.Create a Page ( Remember the slug has to be the same of that of action of the form of phase one ) and assign the template template-confirmation-mail.php | |
| 2.This page is responsible for generating unqiue hash key and sending that hash key along with the user's new account credentials to their email. | |
| 3.Remember the link of the activation_link has to the link to the email-verification template, which we will be creating in next phase. | |
| Third Phase : | |
| 1. Create a page and assign it to Email Verification Template.( Remember this template has to be assigned to the page that you sent in the mail in previous step ) | |
| 2. This page is responsilble matching that unqiue key sent on the email once new user visit that page. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // Manually create entries and send notifications with Gravity Forms | |
| $form_id = 10; | |
| // add entry | |
| $entry = array( | |
| "form_id" => $form_id, | |
| "1" => "Entry for field ID 1", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Add the product's short description (excerpt) to the WooCommerce shop/category pages. The description displays after the product's name, but before the product's price. | |
| * | |
| * Ref: https://gist.github.com/om4james/9883140 | |
| * | |
| * Put this snippet into a child theme's functions.php file | |
| */ | |
| function woocommerce_after_shop_loop_item_title_short_description() { | |
| global $product; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * list taxonomy accoeding to the custom post type | |
| * @var [string] | |
| * ref: http://codex.wordpress.org/Template_Tags/wp_list_categories | |
| */ | |
| $custom_taxonomy = get_object_taxonomies('taxonomy-slud-or-id'); | |
| if(count($custom_taxonomy) > 0): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| add_filter( 'woocommerce_checkout_fields' , 'custom_override_checkout_fields' ); | |
| function custom_override_checkout_fields( $fields ) { | |
| unset($fields['billing']['billing_company']); | |
| return $fields; | |
| } | |
| ?> |
NewerOlder