Skip to content

Instantly share code, notes, and snippets.

View kish2011's full-sized avatar
🏠
Working from home

Kishore Chandra Sahoo kish2011

🏠
Working from home
View GitHub Profile
@kish2011
kish2011 / Contract Killer 3.md
Created March 28, 2017 17:00
The latest version of my ‘killer contract’ for web designers and developers

Contract Killer

The popular open-source contract for web professionals by Stuff & Nonsense

  • Originally published: 23rd December 2008
  • Revised date: March 15th 2016
  • Original post

@kish2011
kish2011 / function.php
Last active February 3, 2020 16:49
Add [past_applications] ShortCode to BuddyPress Job Manager
function setup_past_application_nav() {
global $bp;
if ( ! class_exists( 'WP_Job_Manager' ) )
return;
if ( ! class_exists( 'BP_Job_Manager' ) )
return;
if ( ! class_exists( 'WP_Job_Manager_Applications' ) )
return;
@kish2011
kish2011 / function.php
Created March 23, 2017 12:05
Give user option to select NA/ Leave the rating for a particular category.
/**
* Allow to remove method for an hook when, it's a class method used and class don't have variable, but you know the class name :)
*/
function remove_filters_for_anonymous_class( $hook_name = '', $class_name ='', $method_name = '', $priority = 0 ) {
global $wp_filter;
// Take only filters on right hook name and priority
if ( !isset($wp_filter[$hook_name][$priority]) || !is_array($wp_filter[$hook_name][$priority]) )
return false;
// Loop on filters registered
foreach( (array) $wp_filter[$hook_name][$priority] as $unique_id => $filter_array ) {
@kish2011
kish2011 / functions.php
Created March 23, 2017 09:26 — forked from tripflex/functions.php
WordPress Remove Filter (remove_filter converted to remove_class_filter) to remove Filter/Action without Class Object access. Works with WordPress 1.2+ (4.7+ support added 9-19-2016)
<?php
/**
* Remove Class Filter Without Access to Class Object
*
* In order to use the core WordPress remove_filter() on a filter added with the callback
* to a class, you either have to have access to that class object, or it has to be a call
* to a static method. This method allows you to remove filters with a callback to a class
* you don't have access to.
*
* Works with WordPress 1.2+ (4.7+ support added 9-19-2016)
<?php
/**
* WP_Job_Manager_Form_Register class.
*/
class WP_Job_Manager_Form_Register extends WP_Job_Manager_Form {
public static $form_name = 'register';
protected static $job_id;
protected static $preview_job;
protected static $steps;
@kish2011
kish2011 / job-listings-start.php
Created March 6, 2017 11:47
job-listings-start.php
<h2 id="titlebar">Showing <span class="count_jobs"></span> Jobs</h2>
<ul class="job_listings">
@kish2011
kish2011 / count-jobs.php
Created March 6, 2017 11:42
count-jobs.php
/*
* @see WP_Job_Manager_Ajax class line 211 wp_send_json( apply_filters( 'job_manager_get_listings_result', $result, $jobs ) );
*
*/
function custom_job_manager_get_listings_result($result, $jobs) {
$result['post_count'] = $jobs->found_posts;
return $result;
}
add_filter( 'job_manager_get_listings_result', 'custom_job_manager_get_listings_result',10,2 );
@kish2011
kish2011 / count-jobs.js
Last active September 29, 2017 05:18
count-jobs.js
/* add live job count on job search */
jQuery( document ).ready( function ( $ ) {
$('div.job_listings').on('updated_results', (function(_this) {
return function(event, results) {
$('#titlebar .count_jobs').html(results.post_count);
};
})(this));
});
@kish2011
kish2011 / jobster-jobs-function.php
Created February 21, 2017 07:21
Jobster_WP_Job_Manager_Output_Jobs
if (class_exists('WP_Job_Manager_Shortcodes')) {
/**
* Jobster_WP_Job_Manager_Output_Jobs class.
*/
class Jobster_WP_Job_Manager_Output_Jobs extends WP_Job_Manager_Shortcodes {
/**
* __construct function.
* @see add_shortcode( 'jobs', array( $this, 'output_jobs' ) ); in core plugin.
*
@kish2011
kish2011 / function.php
Last active February 20, 2017 12:02
Featured Companies Widget
function featured_company_register_widgets() {
if ( ! class_exists( 'WP_Job_Manager_Widget' ) ) {
return;
}
/**
* Featured Companies Widget
*/
class WP_Job_Manager_Widget_Featured_Company extends WP_Job_Manager_Widget {