How can I show a block on a specific page if a custom PHP function evaluates to be true? Follow-up to the question "How can I show a single block only if the user is on iOS?".

I am using D7 and trying to show a message to iOS users that their devices of choice do not support basic upload functionality.  I have a block that I would like to show only on the following path: node/add/profile-picture if the function mymodule_is_iOS() returns TRUE.

On the block configuration screen, I can easily limit it to a given path by adding the path to Show block on specific pages.  However, if I do that, I cannot select Pages on which this PHP code returns TRUE to limit it to users for which the function mymodule_is_iOS() returns true.

I found some documentation on Drupal.org here (Combining PHP visibility control with specific page visibility) but it isn't relevant to my case.

Is there a way to do this by adding another function to my custom module for the site or theme?  I'm not an expert in PHP but I do have custom functions in a custom module and in my theme.
By enabling core PHP Filter module, you will see another option "Pages on which this PHP code returns TRUE (experts only)" under Show block on specific pages of the block configuration page. Select the option and write the following code in the box.

&lt;?php
  if (mymodule_is_iOS()) {
    if (arg(0) == 'node' &amp;&amp; arg(1) == 'add' &amp;&amp; arg(2) == 'profile-picture') {
      return TRUE;
    }
  }
  return FALSE;
?&gt;


Your module must have a lower weight than the core PHP filter module to allow this code snippet to call mymodule_is_iOS().