Skip to content

Instantly share code, notes, and snippets.

View gwin's full-sized avatar

Greg Winiarski gwin

View GitHub Profile
@gwin
gwin / wpjb-job-is-bookmarked.php
Last active August 29, 2015 14:20
Checks if current job is already bookmarked
<?php
/**
* Check if current user already bookmarked $job
*
* @var $job Wpjb_Model_Job
* @return boolean True if current user already bookmarked $job
**/
function my_wpjb_job_is_bookmarked(Wpjb_Model_Job $job) {
$id = get_current_user_id();
@gwin
gwin / wpjb-job-already-applied-to.php
Created March 31, 2015 08:48
Check if current user already applied to current job
<?php
/**
* Check if current user already applied to $job
*
* @var $job Wpjb_Model_Job
* @return boolean True if current user already applied to $job
**/
function my_wpjb_job_already_applied_to(Wpjb_Model_Job $job) {
$id = get_current_user_id();
@gwin
gwin / wpadverts-add-currency.php
Created March 29, 2015 09:08
Add new currency
<?php
// The code below you can paste in your theme functions.php or create
// new plugin and paste the code there.
add_filter("adverts_currency_list", "add_adverts_currency");
/**
* Add new currency to the list
*
@gwin
gwin / wpjb-login-customize-1.php
Last active August 29, 2015 14:17
Customize [wpjb_login] shortcode.
<?php
// You can place this code in your theme functions.php file
// or create new plugin and put the code there.
add_filter("wpjb_shortcode_login", "my_wpjb_shortcode_login");
function my_wpjb_shortcode_login(Daq_View $view) {
// Text on login button
$view->submit = "Login Me!" ;
@gwin
gwin / callback.php
Created March 17, 2015 09:12
Form Callback Function
<?php
/**
* Example callback function for filling <select> fields
*
* @retuen array
**/
function my_callback_function() {
return array(
array("key"=> "1", "value"=>"One", "description"=>"One"),
array("key"=> "2", "value"=>"Two", "description"=>"Two"),
@gwin
gwin / wpjb-job-is-bookmarked.php
Last active August 29, 2015 14:17
Check if job is bookmarked by current user.
<?php
/**
* Check if $job is bookmarked by currently logged in user
*
* @var $job Wpjb_Model_Job
* @return boolean True if job is bookmarked, false otherwise
**/
function my_wpjb_job_is_bookmarked(Wpjb_Model_Job $job) {
$id = get_current_user_id();