Skip to content

Instantly share code, notes, and snippets.

View dexit's full-sized avatar
🎯
Focusing

Rihards Mantejs dexit

🎯
Focusing
View GitHub Profile
@dexit
dexit / class-custom-wc-webhook-mangager
Created February 26, 2025 14:57 — forked from onetarek/class-custom-wc-webhook-mangager
Add new WooComerce Webhook topic only for order completed
<?php
/*
Custom WC Webhook Manager
Add new webhook topic only for WC order completed.
Developed by Md Jahidul Islam ( oneTarek ) https://onetarek.com
*/
//Don't allow direct access
if( ! defined( 'ABSPATH' ) ) exit;
@dexit
dexit / AdminPage.php
Created February 12, 2025 20:00 — forked from carlalexander/AdminPage.php
WordPress and the single responsibility principle
<?php
namespace WPMemeShortcode;
/**
* The WordPress Meme Shortcode admin page.
*
* @author Carl Alexander
*/
class AdminPage
<?php
/*
Plugin Name: Rad Webhook Demo
Plugin URI: <https://vrhermit.com/?p=4154>
Description: Adds custom WP JSON endpoints that use the FileMaker OData API to submit form data to FileMaker.
Version: 1.0
Author: radicalappdev
Author URI: <https://radicalappdev.com/>
*/
@dexit
dexit / webhook.php
Created February 10, 2025 23:11 — forked from gingerbeardman/webhook.php
Webhook receiver PHP script
<?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;
<?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',
@dexit
dexit / adding_new_webhook_topics.php
Created February 10, 2025 22:56 — forked from jessepearson/adding_new_webhook_topics.php
How to add a new custom Webhook topic in WooCommerce, with example of order filtering.
<?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.
@dexit
dexit / functions.php
Created December 16, 2024 16:32 — forked from yousufansa/functions.php
Jobhunt - Display Job Category on Job Listings
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 );
@dexit
dexit / functions.php
Created December 16, 2024 16:32 — forked from yousufansa/functions.php
Jobhunt - Replace Job Location With Job Category on Header Search Form
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' );
@dexit
dexit / functions.php
Created December 16, 2024 16:32 — forked from yousufansa/functions.php
Front Jobs - Remove Company Related Fields From Submit Job Form
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'] );
}
@dexit
dexit / functions.php
Created December 16, 2024 16:32 — forked from yousufansa/functions.php
Jobhunt - Change the WP Job Manager Core Add-ons Page Sign in URL
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' );