tareq1988 / wedevs-favorite-post Goto Github PK
View Code? Open in Web Editor NEWYet another favorite post plugin for WordPress
Home Page: https://wordpress.org/plugins/favorite-post/
Yet another favorite post plugin for WordPress
Home Page: https://wordpress.org/plugins/favorite-post/
Is there anyway of pulling in a page/post's feature image? Would be very handy for icons
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!
Hi Tareq,
I was wondering if it's possible to show the amount of clicks on the 'favorites' button per post.
Pieter
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);
}
}
Is there any chance to keep a remove button to remove favourite from lists of favourites of an user ?
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
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?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.