Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Guaraci WordPress Plugin
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
open-source
Guaraci WordPress Plugin
Commits
d37de855
Commit
d37de855
authored
Apr 27, 2020
by
Rafael Chaves Freitas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
modifies post meta keys of facebook api modules to avoid conflict with other plugins
parent
e7fc202d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
library/modules/facebook/index.php
library/modules/facebook/index.php
+7
-7
No files found.
library/modules/facebook/index.php
View file @
d37de855
...
...
@@ -3,10 +3,10 @@
namespace
guaraci
;
function
need_share_update
(
$post_id
)
{
if
(
!
metadata_exists
(
'post'
,
$post_id
,
'shares'
)
)
{
if
(
!
metadata_exists
(
'post'
,
$post_id
,
'
fb_
shares'
)
)
{
// the first time its called create the metadata for the next turn
update_post_meta
(
$post_id
,
'shares'
,
0
);
update_post_meta
(
$post_id
,
'
updated_timestamp
'
,
time
()
);
update_post_meta
(
$post_id
,
'
fb_
shares'
,
0
);
update_post_meta
(
$post_id
,
'
fb_shares_updated_at
'
,
time
()
);
return
false
;
}
elseif
(
update_share_business_rule
(
$post_id
)
)
{
...
...
@@ -26,7 +26,7 @@ function update_share_business_rule( $post_id ) {
// a cada 24h - os demais posts
$rank_position
=
get_post_ranking_position
(
$post_id
)
?:
501
;
// if is not in rank, place into a regular group
$last_time_updated
=
get_post_meta
(
$post_id
,
'
updated_timestamp
'
,
true
);
$last_time_updated
=
get_post_meta
(
$post_id
,
'
fb_shares_updated_at
'
,
true
);
$date_obj
=
\DateTime
::
createFromFormat
(
'U'
,
$last_time_updated
);
$time_interval
=
$date_obj
->
diff
(
new
\DateTime
(
'NOW'
));
...
...
@@ -49,10 +49,10 @@ function update_share_business_rule( $post_id ) {
}
function
set_post_shares
(
$post_id
,
$shares
)
{
update_post_meta
(
$post_id
,
'shares'
,
$shares
);
update_post_meta
(
$post_id
,
'
updated_timestamp
'
,
time
()
);
update_post_meta
(
$post_id
,
'
fb_
shares'
,
$shares
);
update_post_meta
(
$post_id
,
'
fb_shares_updated_at
'
,
time
()
);
}
function
get_post_shares
(
$post_id
)
{
return
get_post_meta
(
$post_id
,
'shares'
,
true
);
return
get_post_meta
(
$post_id
,
'
fb_
shares'
,
true
);
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment