{"id":11233153,"date":"2019-02-21T20:27:53","date_gmt":"2019-02-21T20:27:53","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/hiding-pages-in-functions-php-breaks-jetpack-stats-bar-in-admin-bar\/"},"modified":"2019-02-21T20:27:53","modified_gmt":"2019-02-21T20:27:53","slug":"hiding-pages-in-functions-php-breaks-jetpack-stats-bar-in-admin-bar","status":"publish","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/hiding-pages-in-functions-php-breaks-jetpack-stats-bar-in-admin-bar\/","title":{"rendered":"Hiding Pages in Functions.php breaks Jetpack Stats Bar in Admin Bar"},"content":{"rendered":"<p>Hi guys, <\/p>\n<p>I have input this php to hide a number of pages from being displayed in the search function on my site. Unfortunately, it seems to have broken the stats bar in my administrative bar. But, stats still show on my dashboard, and also, if I navigate to the stats page directly. Is there any way to fix this issue? <\/p>\n<p>Here&#8217;s what I see: https:\/\/rockclass101.com\/wp-content\/uploads\/2019\/02\/JP-Broken.png <\/p>\n<p>Here is the php in my child theme&#8217;s functions.php: <\/p>\n<p>&lt;?php<\/p>\n<p>add_filter(&#8216;pre_get_posts&#8217;,&#8217;your_custom_search_filter&#8217;);<\/p>\n<p>function your_custom_search_filter($query) {<br \/>\nif (!is_admin() &amp;&amp; $query-&gt;is_search) {<br \/>\n$exclude_ids = array(4968, 2721, 801, 2911, 4879, 4900, 741, 211, 2899, 197, 2922, 300, 2935, 263, 2938, 206, 2941, 306, 2944, 303, 2947, 2905, 223, 191, 2950, 186, 2953, 216, 2908, 4899, 1543, 4613, 2432, 2459, 3074, 3062, 394, 3680, 2548, 4876, 4896, 4573, 4512, 1791, 1246, 1417, 354, 1824, 436, 462, 89, 940, 347, 350, 15, 929, 4827, 4834, 881, 4584, 456, 724, 3681, 1430, 1589, 4877, 4897, 2113, 467, 442, 3682, 959, 610, 814, 397, 3668, 449, 3676, 473, 1148, 1826, 3616, 3035, 4878, 4898, 3527, 608, 2350, 4880, 123, 934, 338, 342, 13, 911, 4829, 4835, 4892, 4872, 20, 4874, 4894, 658, 821, 783, 848, 858, 18, 2383, 507, 3580, 1613, 3673, 1614, 3665, 1612, 3660, 1615, 660, 1809, 1811, 1807, 1805, 1577, 2457, 2437, 3082, 3079, 2716, 268, 2956, 775, 2928, 284, 2959, 145, 2962, 249, 2932, 235, 2925, 1055, 3266, 1563, 5129, 2, 2902, 2112, 4871, 4891, 1226, 1688, 4873, 4893, 356, 1823, 453, 463, 1, 8, 9, 10, 11, 12, 5266, 5857, 5862, 6040, 6096, 6097, 6196, 7047, 7459, 7655, 7656, 7657, 7658, 8362, 8707, 8712, 8638, 8922, 9099, 10059, 10594, 10718, 11236, 11477, 11591, 12875, 13213, 14725, 16044, 17039, 18866, 9551, 20224); \/\/page ids you want to exclude<br \/>\n$query-&gt;set(&#8216;post__not_in&#8217;, $exclude_ids);<br \/>\n}<br \/>\nreturn $query;<br \/>\n} ?&gt;<\/p>\n","protected":false},"template":"","class_list":["post-11233153","topic","type-topic","status-publish","hentry","topic-tag-functions","topic-tag-hidden-pages","topic-tag-php","topic-tag-stats"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/11233153","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/11233153\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=11233153"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}