• Hello,

    1. How to make your code below or new button appear only in free ads listed in the [adverts_manage] page, Ads that are already posted as featured should not have this new button.

    2. Also, this new button is very similar in function to the renew button, is there any way to distinguish the two button to avoid confusing users.

    3. Would it be possible to add this button in the advert details page just below the show contact information box.

    add_action( "adverts_sh_manage_actions_left", function( $post_id, $baseurl ) {
        ?>
        <form id="mark-as-featured" action="<?php echo esc_attr($baseurl) ?>" method="post" style="display:inline-block">
        <input type="hidden" name="_adverts_renew" id="_adverts_renew" value="1" />    
        <input type="hidden" name="advert_renew" value="<?php echo esc_attr( $post_id ) ?>" />
        <input type="hidden" name="payments_listing_type" value="409" />
        <a href="#" onclick="document.getElementById('mark-as-featured').submit();" class="adverts-manage-action">
            <span class="adverts-icon-flash"></span>
            Boost Ad $5.00
        </a>
        </form> 
        <?php
    }, 10, 2 );

    Thanks

Viewing 1 replies (of 1 total)
  • Plugin Author Greg Winiarski

    (@gwin)

    Hi,
    1. to show this only if the Ad is free above the line ?> add

    
    if( get_post( $post_id )->menu_order > 0 ) {
      return;
    }
    

    2. to make it display differently than other buttons you would add some additional CSS rules to the <a> tag, for example like this <a ... style="background:red!important">...</a>.

    3. not really as on the Ad details page there is no $baseurl variable which this function is using, you would need to customize this code.

Viewing 1 replies (of 1 total)
  • The topic ‘Mark extisting ad as featured’ is closed to new replies.