Title: function call change splice / str_replace or ?
Last modified: August 18, 2016

---

# function call change splice / str_replace or ?

 *  [ptryk](https://wordpress.org/support/users/ptryk/)
 * (@ptryk)
 * [20 years, 9 months ago](https://wordpress.org/support/topic/function-call-change-splice-str_replace-or/)
 * have begun to create a something to limit number of tries on password protected
   posts/pages (maybe admin even!?) that i would like to make as a plugin
    [http://wordpress.org/support/topic/41340](http://wordpress.org/support/topic/41340)
 * worked up some code.. don’t want to just hack the wp-pass.php and template-funcitons-
   post.php (not very pluginable, then?!) the easiest is to replace the function
   call of ln64 of tempate_functions-post-php
 * `
    $output = get_the_password_form();
 * to call my function .. eg
    ` $output = gt_th_psswrd_frm_authentification();
 * and that function would then call my modified wp-pass.php called something else..
   etc etc..
 * does anyone know any good methods to make this happen?
 * one way i have seen is the splice/replace done is with “str_replace” but in that
   instance it seems this is accomplished with strings (text within ‘ ‘ ) & i am
   having trouble getting it to work to replace the function name!?
 * tried like this..
 * `
    function add_post_password_authentification ($output) { $output = get_the_password_form();
   $output = str_replace ( get_the_password_form(), gt_th_psswrd_frm_authentification(),
   $output); return $output; }
 * but, to no avail… seems like it should / could work..
    [http://se2.php.net/manual/en/function.str-replace.php](http://se2.php.net/manual/en/function.str-replace.php)
 * any ideas? of course, other suggestions or directions are appreciated, i just
   want this to work (as a plugin!)

The topic ‘function call change splice / str_replace or ?’ is closed to new replies.

## Tags

 * [function](https://wordpress.org/support/topic-tag/function/)
 * [password](https://wordpress.org/support/topic-tag/password/)
 * [protection](https://wordpress.org/support/topic-tag/protection/)

 * 0 replies
 * 1 participant
 * Last reply from: [ptryk](https://wordpress.org/support/users/ptryk/)
 * Last activity: [20 years, 9 months ago](https://wordpress.org/support/topic/function-call-change-splice-str_replace-or/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
