View gist:8dd22c6a3b7472ec3461
1 2 3 4 5 6 7 8 9 10
<?php
$twitter_username = get_custom_field('company_twitter');
if( ! empty( $twitter_username ) ) {
$clean_twitter = sanitize_text_field( $twitter_username );
// Check for http: or https: in $clean_twitter
if ( $clean_twitter && ! strstr( $clean_twitter, 'http:' ) && ! strstr( $clean_twitter, 'https:' ) ) {
// Check if twitter.com is not in string (means they used username only)
if( ! strstr( $clean_twitter, 'twitter.com' ) ){
$clean_twitter = "https://twitter.com/{$clean_twitter}";
} else {
View job-submit.php
1 2 3 4 5 6 7 8 9
<?php
/**
* Job Submission Form
*/
if ( ! defined( 'ABSPATH' ) ) exit;
global $job_manager;
?>
<form action="<?php echo esc_url( $action ); ?>" method="post" id="submit-job-form" class="job-manager-form" enctype="multipart/form-data">
View gist:c8e536f544dfce0ca008
1 2 3 4 5
<?php
$shop_url = get_custom_field( 'shop_url' );
if( ! empty( $shop_url ) ){
echo "<a href=\"" . esc_url( $shop_url ) . "\" target=\"_blank\"><img src=\"//domain.com/banners/gotoshop.jpg\"></a>";
}
View gist:b247f29301907c0f18d1
1 2 3 4 5 6 7 8 9 10
<?php
function custom_listify_single_job_listing_actions_after() {
global $post;
$url = get_post_meta( $post->ID, '_company_website', true );
$offerta_url = get_post_meta( $post->ID, '_company_offerta', true );
if( $offerta_url ) echo "<a href=\"" . esc_url( $url ) . "\" class=\"button\" target=\"_blank\">VAI ALL 'OFFERTA</a>";
echo '<a href="' . esc_url( $url ) . '" class="button" target="_blank">Vai al sito</a>';
View formatted.php
1 2 3 4 5 6 7 8 9 10
<?php
$company_description = get_company_field( 'company_description' );
if( $company_description ):
?>
<h4><?php _e( 'About Us', 'petsitter' ); ?></h4>
<?php
echo $company_description;
endif;
?>
View wc.php
1 2 3 4 5 6 7 8 9 10
/**
* Get packages in Field Editor format
*
*
* @since 1.2.2
*
* @param bool $as_array
*
* @return array|string
*/
View functions.php
1 2 3 4 5 6 7 8 9 10
<?php
add_filter( 'job_manager_field_editor_phone_args', 'my_custom_phone_args' );
function my_custom_phone_args( $args ){
// Other available arguments, see GitHub for details
// https://github.com/Bluefieldscom/intl-tel-input#options
//
// $args['allowExtensions'] = 'false';
// $args['autoFormat'] = 'true';
View content-single-job_listing.php
1 2 3 4 5 6 7 8 9
$images = get_custom_field( 'job_multifile' );
if ( is_array( $images ) && ! empty( $images ) ){
foreach( $images as $image ){
$thumbnail_id = get_attachment_id_from_url( $image );
$thumbnail = wp_get_attachment_thumb_url( $thumbnail_id );
echo "<a href=\"{$image}\"><img src=\"{$thumbnail}\"></a>";
}
View functions.php
1 2 3 4 5 6 7 8 9 10
if( ! function_exists( 'get_attachment_id_from_url' ) ){
function get_attachment_id_from_url( $attachment_url = '' ) {
global $wpdb;
$attachment_id = FALSE;
// If there is no url, return.
if ( '' == $attachment_url ) return;
View gist:66f2eb890d5fc07ff324
1 2 3 4 5 6 7 8 9 10
<?php
add_filter('submit_job_form_validate_fields', 'check_price_job_field');
function check_price_job_field( $has_error, $fields, $values ){
// Return true if this field doesn't exist (to prevent errors if you dont have field created)
if( ! isset( $values['job']['price'] ) ) return true;
if( empty( $values['job']['price'] ) || ! is_float( $values['job']['price'] ) ){
Something went wrong with that request. Please try again.