WordPress.org

Ready to get started?Download WordPress

Forums

Front-end Editor
[resolved] Autolink (6 posts)

  1. ataraxia36
    Member
    Posted 3 years ago #

    First thanx for this great plugin
    I use autolinks on my WP (words typed in the content and custom fields redirect to post with same title) for that i use:
    <?php echo apply_filters('the_content', get_post_meta($post->ID, 'the_key', true)); ?>
    My problem, as that's custom field i have to use
    editable_post_meta( get_the_ID(), 'the_key');
    My question, how can I use echo apply_filters('the_content', with editable_post_meta( get_the_ID(), 'the_key');
    I tried stuffs like:
    apply_filters('the_content', editable_post_meta( get_the_ID(), 'the_key')); etc
    thanx (and sorry for my bad english)

  2. ataraxia36
    Member
    Posted 3 years ago #

    no idea?

  3. scribu
    Member
    Plugin Author

    Posted 3 years ago #

    1. Open the Autolink plugin and find the line that looks like this:

    add_filter( 'the_content', 'you_will_need_this_part' );

    2. Copy that second argument into the following line, which should be put somewhere in your theme's functions.php file:

    add_filter( 'post_meta', 'you_will_need_this_part' );

    3. Call editable_post_meta() normally.

  4. ataraxia36
    Member
    Posted 3 years ago #

    thanx for the response but it doesnt worl for me.
    in fact i'm using "SEO Smart Links" plugin. In the plugin file I have:

    add_filter('the_content', array(&$this, 'SEOLinks_the_content_filter'));

    So i added in my function.php

    add_filter('post_meta', array(&$this, 'SEOLinks_the_content_filter'));

    and then in my single.php

    <?php editable_post_meta( get_the_ID(), 'discographie'); ?>

    But it doesnt work, i got this error:

    Warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, 'Array' was given in /homez.85/graphzic/www/xxx/wp-includes/plugin.php on line 166
    [empty]

  5. ataraxia36
    Member
    Posted 3 years ago #

    it's working !
    thank you very much !
    I added the line in the plugin file not in the function.php
    thanx to you !!

  6. scribu
    Member
    Plugin Author

    Posted 3 years ago #

    I added the line in the plugin file not in the function.php

    That works, but you'll have to do it each time the plugin is updated.

    If you take another look at the plugin, you will find this line:

    $SEOLinks = new SEOLinks();

    That means that the $SEOLinks variable contains the reference we need, which we will use like so:

    add_filter('post_meta', array(&$SEOLinks, 'SEOLinks_the_content_filter'));

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic