Advanced Custom Fields(ACF Add On) Add Ons Hack Tip


Hi there,

Today i would like to explain about Advanced Custom Fields(ACF Add On) Add On activation for Free. You have append a one line to the specific file of the ACF WordPress Plugin.

/plugins/advanced-custom-fields/acf.php

Find this function:

function is_field_unlocked($field_name){
$hashes = array(
'repeater' => 'bbefed143f1ec106ff3a11437bd73432',
'options_page' => '1fc8b993548891dc2b9a63ac057935d8',
'flexible_content' => 'd067e06c2b4b32b1c1f5b6f00e0d61d6',
'gallery' => '69f4adc9883195bd206a868ffa954b49',
);

Append this row like this:

function is_field_unlocked($field_name){
return true;
$hashes = array(
'repeater' => 'bbefed143f1ec106ff3a11437bd73432',
'options_page' => '1fc8b993548891dc2b9a63ac057935d8',
'flexible_content' => 'd067e06c2b4b32b1c1f5b6f00e0d61d6',
'gallery' => '69f4adc9883195bd206a868ffa954b49',
);

You have to add this line return true; first line of the is_field_unlocked function.

I hope it helps some one. If any suggestion, welcome to our comments area(Just bottom of this page).

If you like this post, please like me via Facebook Like Box.

Thank you.

Advertisements

How to add a shortcode for custom menu item in WordPress


Hi Guys,

Today i will explain how to use short code for custom menu item in navigation.

I have tried and got the result for it. Here i explained how i did it.

First you have to install the this plugin for url short-code -> http://wordpress.org/extend/plugins/peters-blog-url-shortcodes/

Add this code to your functions.php file with your theme.


class description_walker extends Walker_Nav_Menu{
function start_el(&$output, $item, $depth, $args)
{
global $wp_query;
$indent = ( $depth ) ? str_repeat( "\t", $depth ) : '';

$class_names = $value = '';

$classes = empty( $item->classes ) ? array() : (array) $item->classes;

$class_names = join( ' ', apply_filters( 'nav_menu_css_class', array_filter( $classes ), $item ) );
$class_names = ' class="'. esc_attr( $class_names ) . '"';

$output .= $indent . '

  • ID . '"' . $value . $class_names .'>';

    $attributes = ! empty( $item->attr_title ) ? ' title="' . esc_attr( $item->attr_title ) .'"' : '';
    $attributes .= ! empty( $item->target ) ? ' target="' . esc_attr( $item->target ) .'"' : '';
    $attributes .= ! empty( $item->xfn ) ? ' rel="' . esc_attr( $item->xfn ) .'"' : '';

    //echo $item->url;
    $string = explode('::', $item->url, 3);
    if($string[1]){
    $string[1] = str_replace('-',' ', $string[1] );
    $item->url = do_shortcode("[$string[1]]");
    }

    $attributes .= ! empty( $item->url ) ? ' href="' . esc_attr( $item->url ) .'"' : '';

    $prepend = '';
    $append = '
    ';
    $description = ! empty( $item->description ) ? ''.esc_attr( $item->description ).'' : '';

    if($depth != 0)
    {
    $description = $append = $prepend = "";
    }

    $item_output = $args->before;
    $item_output .= '';
    $item_output .= $args->link_before .$prepend.apply_filters( 'the_title', $item->title, $item->ID ).$append;
    $item_output .= $description.$args->link_after;
    $item_output .= '
    ';
    $item_output .= $args->after;

    $output .= apply_filters( 'walker_nav_menu_start_el', $item_output, $item, $depth, $args );
    }
    }

    Then you have to call this function from wp_nav_menu from the templates files.


    $arg = array( 'menu' => "main-menu", 'echo' => true, 'fallback_cb' => 'wp_page_menu', 'depth' => 0, 'walker' => new description_walker() );

    wp_nav_menu( $arg );

    Thats it. Then go to the back-end with menu section.

    For example i want to give the page URL to custom link.

    I will add like this —–> http://::blogurl-id=’1302′::

    That’s All.

    Now you can go to the front-end and check the shortcode will work.

    Thanks.