• this is my face shocked! :0

    To see people in here using hooks and filters, and then hacking core code to complete the fix…. yea, thats not a solution.

    We are adding code like this, but for some reason its repeating itself 5 times (which you are able to see because I placed a cursor that displays)

    function my_sticky_option($column_name) {
    	global $post;
    	global $cursortemp;
    	if($cursortemp < 1) $cursortemp = 1;
    	else $cursortemp = $cursortemp + 1;
    
    	if ($post->post_type == 'ad_listing'): ?>
    	<fieldset class="inline-edit-col-right">
    		<div class="inline-edit-col">
    			<label class="alignleft">
    				<input type="checkbox" name="sticky" value="sticky" />
    				<span class="checkbox-title"><?php _e('Featured Ad (sticky)', 'wp'); echo 'c'.$cursortemp; ?></span>
    			</label>
    		</div>
    	</fieldset>
    <?php
    	endif;
    }
    
    add_action('quick_edit_custom_box', 'my_sticky_option');

    trying now to find a solution to that problem…

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter Seth Carstens

    (@sethcarstens)

    wow, that was quick, thanks wordpress codex for the help! lol.

    there was an easy lookup function to make sure it only adds the custom input field. Note that this code will ad “sticky posts” functionality to wordpress until they release a version that supports sticky on custom post types.

    function my_sticky_option() {
    	global $post;
    
    	//if post is a custom post type and only during the first execution of the action quick_edit_custom_box
    	if ($post->post_type == 'custom_post_type' && did_action('quick_edit_custom_box') === 1): ?>
    
    	<fieldset class="inline-edit-col-right">
    		<div class="inline-edit-col">
    			<label class="alignleft">
    				<input type="checkbox" name="sticky" value="sticky" />
    				<span class="checkbox-title"><?php _e('Featured Ad (sticky)', 'my_plugin'); ?></span>
    			</label>
    		</div>
    	</fieldset>
    <?php
    	endif;
    }
    //add the sticky option to the quick edit area
    add_action('quick_edit_custom_box', 'my_sticky_option');

    Do we need to have custom post type to work ?

    Thread Starter Seth Carstens

    (@sethcarstens)

    no, you should just be able to use “posts” or “pages” I believe and it will push the changes into normal posts and pages.

    Hi Im working on classipress 3.1.6 and Im using this plugin as a widget I wonder would be posible used as slider on every category but only to pickup the category.

    LIke if you are watching the cars category only display on the slider the featured ads from cars category and the same for each category?

    The same work as default, but using only like the slider (carrousel), not a widget on siderbar..

    Can you help?

    Thread Starter Seth Carstens

    (@sethcarstens)

    ClassiPress doesn’t have a widget area that works near the slider carousel, and this plugin on works as a widget. I don’t think its going to accomplish what your looking for until ClassiPress creates more widget areas.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘quick_edit_custom_box without core hacks’ is closed to new replies.