Hide the post count behind Post Views (Remove All, Published and Trashed) in Custom Post Type

There is, unfortunately, no “pretty” way to do this (i.e. without using string replacing or rewriting a big chunck of functionality). So, resorting to preg_replace… We’ll need to filter the links, and it’s good to see that you’ve already found the proper filters! Looping through the views and using a regular expression, we can remove … Read more

select * from table where column = something or, when unavailable, column = something else

You can provide a custom ordering, then take the first row, like this: Explanation: The inner select’s order by field(LOCALE, ‘ge’, ‘_’) gets you the rows in the order you define – in this case German first if it exists, then English (you could add more languages to the list). The “trick” here is using mysql’s “non-standard” GROUP … Read more

Attempt to present UIViewController on UIViewController whose view is not in the window hierarchy

Where are you calling this method from? I had an issue where I was attempting to present a modal view controller within the viewDidLoad method. The solution for me was to move this call to the viewDidAppear: method. My presumption is that the view controller’s view is not in the window’s view hierarchy at the point that it has been loaded … Read more

Attempt to present UIViewController on UIViewController whose view is not in the window hierarchy

Where are you calling this method from? I had an issue where I was attempting to present a modal view controller within the viewDidLoad method. The solution for me was to move this call to the viewDidAppear: method. My presumption is that the view controller’s view is not in the window’s view hierarchy at the point that it has been loaded … Read more