Support » Plugin: HookPress » Deprecated function used

  • Hi there,

    Great plugin, but looks like you’re using a deprecated function ‘ereg’ in services.php hookpress_ajax_get_fields()

    This function has been deprecated since PHP 5.3.0 and is now removed in PHP7.

    Currently due to this the plugin doesn’t work on PHP7 environments…

    Hope you can fix it on the next release.

    Cheers,
    Josh

    https://wordpress.org/plugins/hookpress/

Viewing 9 replies - 1 through 9 (of 9 total)
  • ruess

    (@ruess)

    Great catch Josh!

    For those who need this to work with PHP 7, I’d recommend replacing line 13 of services.php from

    if (ereg('[A-Z]+',$arg))

    to

    if (preg_match('/[A-Z]+/i', $arg))

    Also replace line 100 in includes.php with the same thing.

    One other thing you’ll need to replace line 60 in services.php

    Change

    ‘fields’=>split(‘,’,$_POST[‘fields’]),

    to

    ‘fields’=>explode(‘,’,$_POST[‘fields’]),

    • This reply was modified 5 years, 9 months ago by SeedProd.
    • This reply was modified 5 years, 9 months ago by SeedProd.

    Hi, Added these changes with the current WP version 4.8 and PHP7 but the fields are not saved

    Hi Frank,

    You have to change
    ‘fields’=>split(‘,’,$_POST[‘fields’]),
    to
    fields’=>explode(‘,’,$_POST[‘fields’]),

    within both $edithook and $newhook array. Along with the edit of @ruess it should work fine.

    Bye the way: if you google on e.g. my name and HookPress you will find a fork. You can also download this one and use it.

    Hi @willemdumee
    Thanks, Just to confirm for myself and others that this is your fork that works with PHP7 –
    https://github.com/Willemdumee/hookpress

    @willemdumee FYI – thanks, your fork works well

    @frankwarwick your welcome

    Hi,
    Is there a way to use HookPress with custom post and field types. I have created a post type with Pods and need to be able to use the custom post type’s fields with Zapier.
    Any help is greatly appreciated. Btw I am not a developer.
    Thanks.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Deprecated function used’ is closed to new replies.