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 | |
// GitHub webhook secret (set this in your GitHub webhook settings) | |
$secret = "Y0UR-secret-text-here!"; | |
// Get the payload | |
$payload = file_get_contents('php://input'); | |
// Verify the signature | |
$signature = $_SERVER['HTTP_X_HUB_SIGNATURE'] ?? null; |
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( 'rest_api_init', 'custom_routes_webhook_0277'); | |
function custom_routes_webhook_0277(){ | |
//(exemplo: /wp-json/exemplo/notificacoes) | |
register_rest_route( | |
'exemplo', '/notificacoes/', 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
<?php // do not copy this line | |
/** | |
* add_new_topic_hooks will add a new webhook topic hook. | |
* @param array $topic_hooks Esxisting topic hooks. | |
*/ | |
function add_new_topic_hooks( $topic_hooks ) { | |
// Array that has the topic as resource.event with arrays of actions that call that topic. |
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 downloadImagesAsZip(className) { | |
const zip = new JSZip(); | |
const imgFolder = zip.folder("images"); | |
const images = document.querySelectorAll(".team-member-photo img"); | |
const imagePromises = Array.from(images).map(async (img, index) => { | |
const src = img.getAttribute('src'); | |
if (src) { | |
try { | |
const response = await fetch(src); |
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
if ( ! function_exists( 'jh_child_template_job_listing_category' ) ) { | |
function jh_child_template_job_listing_category() { | |
global $post; | |
$post = get_post( $post ); | |
echo '<div class="job-listing-loop-category">' . jobhunt_get_wpjm_taxomony_data( $post, 'job_listing_category', false ) . '</div>'; | |
} | |
} | |
add_action( 'jobhunt_job_listing_title', 'jh_child_template_job_listing_category', 65 ); |
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
if( ! function_exists( 'jh_child_job_header_search_block_enable_categories' ) ) { | |
function jh_child_job_header_search_block_enable_categories( $args ) { | |
if( is_post_type_archive( 'job_listing' ) || is_page( jh_wpjm_get_page_id( 'jobs' ) ) ) { | |
$args['show_category_select']= true; | |
} | |
return $args; | |
} | |
} | |
add_filter( 'jobhunt_job_header_search_block_args', 'jh_child_job_header_search_block_enable_categories' ); |
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
if ( ! function_exists( 'front_child_mas_wpjmc_remove_submit_job_form_company_fields' ) ) { | |
function front_child_mas_wpjmc_remove_submit_job_form_company_fields( $fields ) { | |
if( get_option( 'job_manager_job_submission_required_company' ) ) { | |
unset( $fields['company']['company_name'] ); | |
unset( $fields['company']['company_website'] ); | |
unset( $fields['company']['company_video'] ); | |
unset( $fields['company']['company_twitter'] ); | |
unset( $fields['company']['company_logo'] ); | |
unset( $fields['company']['company_about'] ); | |
} |
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( 'submit_job_form_login_url', 'jobhunt_submit_job_form_login_url' ); | |
add_filter( 'job_manager_job_dashboard_login_url', 'jobhunt_submit_job_form_login_url' ); | |
add_filter( 'submit_resume_form_login_url', 'jobhunt_submit_job_form_login_url' ); | |
add_filter( 'resume_manager_candidate_dashboard_login_url', 'jobhunt_submit_job_form_login_url' ); | |
add_filter( 'job_manager_alerts_login_url', 'jobhunt_submit_job_form_login_url' ); | |
add_filter( 'job_manager_bookmark_form_login_url', 'jobhunt_submit_job_form_login_url' ); | |
add_filter( 'job_manager_past_applications_login_url', 'jobhunt_submit_job_form_login_url' ); |
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
if ( ! function_exists( 'around_wc_order_item_name' ) ) { | |
function around_wc_order_item_name( $name, $item ){ | |
$variation_id = $item['variation_id']; | |
if( $variation_id > 0 ) { | |
$product_id = $item['product_id']; | |
$_product = wc_get_product( $product_id ); | |
$product_name = $_product->get_title(); | |
$_name = $product_name; | |
$variation_name = str_replace( $product_name . ' -', '', $item->get_name() ); | |
$_name .= '<span class="your-class">' . $variation_name . '</span>'; |
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 | |
// Custom registration form for WooCommerce | |
function custom_woocommerce_register_form() { | |
$user_role = ( ! empty( $_POST['user_role'] ) ) ? sanitize_text_field( $_POST['user_role'] ) : ''; | |
$company_id = ( ! empty( $_POST['company_id'] ) ) ? sanitize_text_field( $_POST['company_id'] ) : ''; | |
?> | |
<p class="form-row form-row-wide"> | |
<label for="user_role"><?php _e( 'Choose account type', 'woodmart' ); ?></label> |