-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtootpress_set.php
More file actions
59 lines (44 loc) · 930 Bytes
/
Copy pathtootpress_set.php
File metadata and controls
59 lines (44 loc) · 930 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<?php
/**
* Set Functions
*
* @package TootPress
* @since 0.1
*/
// Security: Stops code execution if WordPress is not loaded
if (!defined('ABSPATH')) { exit; }
/**
* Set latest Toot
*
* @since 0.1
*
*/
function tootpress_set_latest_toot() {
global $wpdb;
$table_name=$wpdb->prefix . 'tootpress_toots';
$latest_toot=$wpdb->get_var( "SELECT MAX(toot_mastodon_id) FROM $table_name" );
update_option('tootpress_latest_toot',$latest_toot);
}
/**
* Set oldest Toot
*
* @since 0.1
*
*/
function tootpress_set_oldest_toot() {
global $wpdb;
$table_name=$wpdb->prefix . 'tootpress_toots';
$oldest_toot=$wpdb->get_var( "SELECT MIN(toot_mastodon_id) FROM $table_name" );
update_option('tootpress_oldest_toot',$oldest_toot);
}
/**
* Set Last Run
*
* @since 0.1
*
*/
function tootpress_set_last_insert() {
$now=date_i18n( 'Y-m-d H:i:s' );
update_option('tootpress_last_insert',$now);
}
?>