Support » Plugin: YOURLS Link Creator » Turn off function to add clicks to admin in WP

  • Resolved neotrope

    (@neotrope)


    Hi, how would we *disable* the functions in plugin which
    a) do chron ping of YOURLS to get clicks
    b) remove the clicks from the admin screen

    we really only need
    a) auto generation of shortcode via API to use with post sharing
    b) we can go to the YOURLS install to see clicks as needed

    ====
    feedback

    also, from theme docs not clear “which” URL to put into the plugin setting, such as the API URL or the main URL or /path/on/server to php install.

    We presumed the API URL from the tools page, but I can see some folks going huh??

    https://wordpress.org/plugins/yourls-link-creator/

Viewing 6 replies - 1 through 6 (of 6 total)
  • BTW, works great at creating the shortcode! Worked first time out. 🙂

    ==
    I know I can likely simply delete lines 61-64, 124-159 to remove chron, but not sure on the admin hooks for showing the clicks …

    obviously don’t want to mess with your hooks added to the “edit post” section.

    Hope that all made sense 🙂

    Plugin Author Andrew Norcross

    (@norcross)

    I can add something to disable the cron jobs via filter. For the admin count column, you can add this to your functions file:

    add_filter( 'manage_posts_columns', 'rkv_post_column_items' );
    
    function post_column_items( $columns ) {
    
    	// Remove the column
    	unset( $columns['yourls-click'] );
    
    	// Send back the array of columns.
    	return $columns;
    }

    Plugin Author Andrew Norcross

    (@norcross)

    ok. I just pushed an updated version. Update your version, then use the following code:

    add_filter( 'yourls_run_cron_jobs', '__return_false' );

    and never modify the source code, it’ll get wiped out with any subsequent changes.

    Hey, Andrew!
    Thanks for doing that. In our case, am trying to cut back queries and outbound stuff since we have a high traffic site with a LOT going on, so trimming out stuff we don’t actually need saves some keebler elves from crying at night, or something like that 🙂

    I’ll give this a go Sat. morning. Got sidetracked with the AMP roll out and I found a bug in the Automattic AMP plugin for this very same project.

    My job = being a pain for fun and glory!
    (I woke up in weird mood today.)

    THANK YOU!
    I will update this once I try this out.

    HI, Andrew
    thanks for all of that.
    Just tried this out, and one issue ran into, was this code in functions.php actually ended up hiding ALL the columns for posts — where both not posts shown on post screen, and ALL the “show items” elements were no longer there to either check/uncheck … guess I’ may be missing a closing tag or something:

    add_filter( 'yourls_run_cron_jobs', '__return_false' );
    
    add_filter( 'manage_posts_columns', 'rkv_post_column_items' );
    
    function post_column_items( $columns ) {
    
    	// Remove the column
    	unset( $columns['yourls-click'] );
    
    	// Send back the array of columns.
    	return $columns;
    }

    For the moment I just added the first filter; and then simply unchecked the visibility for the count, presuming no counting pings will actually happen.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Turn off function to add clicks to admin in WP’ is closed to new replies.