Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter moabmike579

    (@moabmike579)

    Vijay – thanks so much! Similarly, I discovered that using include_once() rather than include() did the trick.

    Moab Mike

    Thread Starter moabmike579

    (@moabmike579)

    Javier, thanks so much! I now call wp_remote_get($url) directly from MICplugins.php; works fine.

    However, if I may ask another WP 101 question:

    Suppose I have an ordinary text file, local rather than remote, call it parameters.csv, in my Plugin folder along with MICplugins.php itself. I wish to read its contents into a PHP string, then together with wp_remote_get($url)’s contents and date/time, construct my web page’s contents.

    But I can find no PHP method listed in codex.wordpress.org/Function_Reference with which to do a local text read into a string, such a common thing. What have I missed?

    I do however see in https://developer.wordpress.org/reference/functions/ the method get_file($path) whose sources are found in wp-admin/includes/noop.php. Can or should I use this method? plugins_url() generates the correct path to parameters.csv, but get_file($path) fails; don’t know why.

    Thank you again, Moab Mike D

Viewing 2 replies - 1 through 2 (of 2 total)