I have added the following lines to the user.php file in sages “app” directory.
add_action('personal_options', __NAMESPACE__ . '\\show_users_followed_pages');
function show_users_followed_pages($user) {
$user_id = $user->ID;
?>
<table class="form-table">
<tbody>
<?php
$notifications = \Roots\Sage\Notifications\PageNotifications::get_instance();
$pages = $notifications->get_users_subscribed_pages($user_id);
if (!empty($pages)) {
?>
<th scope="row"><h2>Followed Pages</h2></th>
<?php
foreach($pages as $page) {
echo "<tr>";
echo "<td><em>$page->post_title</em></td>";
echo "</tr>";
}
}
?>
</tbody>
</table>
<?php
}
add_action( 'personal_options', __NAMESPACE__ . '\\show_users_quick_links' );
function show_users_quick_links($user) {
// $user_meta = get_user_meta($user);
$user_id = $user->ID;
if($user_id != 0) {
$user_meta = get_user_meta($user_id, "quick_links");
}
?>
<table class="form-table">
<tbody>
<?php
if (!empty($user_meta)) {
?>
<th scope="row"><h2>Quick Links</h2></th>
<?php
foreach($user_meta[0] as $page_id) {
$link = htmlspecialchars_decode(get_the_title($page_id));
echo "<tr>";
echo "<td><em>$link</em></td>";
echo "</tr>";
}
}
?>
</tbody>
</table>
<?php
}
And the following to notifications.php
function get_users_subscribed_pages($user, $args = null) {
if (is_int($user))
$user = get_userdata($user)->user_login;
$post_args = array(
'tax_query' => array(
array(
'taxonomy' => $this->notifications_taxonomy,
'field' => 'slug',
'terms' => $user,
)
),
'orderby' => 'modified',
'order' => 'DESC',
'post_status' => 'any',
'post_type' => 'page',
'posts_per_page' => -1
);
$pages = get_posts($post_args);
return $pages;
}
Whenever I deploy, the changes are not showing up on any of the users profiles on my staging server. The deployment runs successfully, I made sure to composer update from both the theme and the site root directory.
I am at a complete loss.