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
| function qsa_get_editable_roles() { | |
| global $wp_roles; | |
| $all_roles = $wp_roles->roles; | |
| $editable_roles = apply_filters('editable_roles', $all_roles); | |
| // var_dump($editable_roles); | |
| } |
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 | |
| // @see https://css-tricks.com/snippets/wordpress/dump-all-custom-fields/ | |
| ?> | |
| <h3>All Post Meta</h3> | |
| <?php $getPostCustom = get_post_custom(); // Get all the data ?> | |
| <?php | |
| foreach( $getPostCustom as $name => $value ) : |
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
| function qsa_purchase_success_callback( $order_id ) { | |
| $order = wc_get_order( $order_id ); | |
| $user = $order->get_user(); | |
| $uid = $order->get_user_id(); | |
| qsa_update_user_meta($uid); | |
| } |
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
| function qsa_save_user_profile_callback( $user_id ) { | |
| qsa_update_user_meta($user_id); | |
| } | |
| add_action( 'profile_update', 'qsa_save_user_profile_callback', 10, 2 ); | |
| /** | |
| * FYKI: the below hooks should work, theoretically - only they don't. :( | |
| */ |
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
| function qsa_purchase_success_callback( $order_id ) { | |
| $order = wc_get_order( $order_id ); | |
| $user = $order->get_user(); | |
| $cid = $order->get_user_id(); | |
| qsa_update_user_meta($cid); | |
| } |
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 | |
| /** | |
| * There seem to be two versions. | |
| * | |
| * Version 1 - if it works as expected, use this one!!! | |
| * @see https://wpdevdesign.com/how-to-override-woocommerce-templates-using-a-custom-functionality-plugin/ | |
| * | |
| * Version 2 | |
| * @see https://wisdmlabs.com/blog/override-woocommerce-templates-plugin/ |
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 | |
| $downloads = $product->get_files(); | |
| foreach( $downloads as $key => $download ) : | |
| echo '<p class="download-link"><a href="' . esc_url( $download['file'] ) . '">' . $download['name'] . '</a></p>'; | |
| endforeach; |
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 | |
| function keto_list_post_types() { | |
| $args = array( | |
| 'public' => true, | |
| '_builtin' => false | |
| ); | |
| $output = 'names'; // 'names' or 'objects' (default: 'names') |