Git Product home page Git Product logo

wedevs-favorite-post's Issues

Feature Request

Is there anyway of pulling in a page/post's feature image? Would be very handy for icons

Add filters to shortcode.

Hello. I get a project with yours Wordpress Plugin Version: 0.1 Favorite Posts. I'm beginner in wordpress develop. If you could answer a few questions I would be happy.

I see that you register shortvode in constructor on 91 line in wp-content/plugins/favorite-post/favorite-post.php

add_shortcode( 'favorite-post', array($this, 'display_shortcode') );

and on the display_shortcode function you proccessed all shortcode calls

$atts = extract( shortcode_atts( array('user_id' => 0, 'count' => 10, 'post_type' => 'all', 'remove_link' => false), $atts ) );

But i don't understand how i can to intercept this execution, because you not set name of short code on shortcode_atts function (3rd argument)

May be it must be as

$atts = extract( shortcode_atts( array('user_id' => 0, 'count' => 10, 'post_type' => 'all', 'remove_link' => false), $atts, 'favorite-post') );

Thanks!

Favorite count

Hi Tareq,

I was wondering if it's possible to show the amount of clicks on the 'favorites' button per post.

Pieter

Output number of favorites

Hi Tareq how are you? I'am looking for a simple way to output total number of favorites for each post. I'm using code below into my functions:

// Count number of posts
function getFavNumber($postID){
$count_key = 'post_fav_count';
$count = get_post_meta($postID, $count_key, true);
if($count==''){
delete_post_meta($postID, $count_key);
add_post_meta($postID, $count_key, '0');
return '0 Favorites';
}
return $count.' Favorites';
}

// Count Favorites
function setFavNumber($postID) {
$count_key = 'post_fav_count';
$count = get_post_meta($postID, $count_key, true);
if($count==''){
$count = 0;
delete_post_meta($postID, $count_key);
add_post_meta($postID, $count_key, '0');
}else{
$count++;
update_post_meta($postID, $count_key, $count);
}
}

Store multiple values in single field

Is it possible to store all the favorited post ID of each user in a single field separated by comma? so that there will be only single row for each user_id.

For eg:
user_id 5
post_id 2,7,14,23

Thanks

Best practices?

Hello,

i'm a niewbie in wp, and i want to try your plugin.

could you please desribe 2nd point in README? where should i put this function?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.