New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

find_replace_templates() should accept a template SID #889

Closed
Sama34 opened this Issue Jul 6, 2014 · 5 comments

Comments

Projects
None yet
3 participants
@Sama34
Contributor

Sama34 commented Jul 6, 2014

@Sama34 Sama34 added this to the 1.8 Beta 3 milestone Jul 6, 2014

@Sama34 Sama34 self-assigned this Jul 6, 2014

@ATofighi

This comment has been minimized.

Show comment
Hide comment
@ATofighi

ATofighi Jul 6, 2014

Contributor

I think it's better if We can use array.
for example:

find_replace_templatesets('title', 'find', 'replace' , 1, array(1, 2));
Contributor

ATofighi commented Jul 6, 2014

I think it's better if We can use array.
for example:

find_replace_templatesets('title', 'find', 'replace' , 1, array(1, 2));
@Sama34

This comment has been minimized.

Show comment
Hide comment
@Sama34

Sama34 Jul 6, 2014

Contributor

@ATofighi I thought about that, but the main point was to run this right after a theme was created/imported. You can't create/import multiple themes at the same time.

Also, this doesn't seem to work so feel free to provide a fix until I get the chance to fix it myself.

Contributor

Sama34 commented Jul 6, 2014

@ATofighi I thought about that, but the main point was to run this right after a theme was created/imported. You can't create/import multiple themes at the same time.

Also, this doesn't seem to work so feel free to provide a fix until I get the chance to fix it myself.

@PirataNervo

This comment has been minimized.

Show comment
Hide comment
@PirataNervo

PirataNervo Jul 19, 2014

Contributor

@Sama34 is this done? I mean, we have no PR for this, it was committed directly so it must get into Beta 3...

Contributor

PirataNervo commented Jul 19, 2014

@Sama34 is this done? I mean, we have no PR for this, it was committed directly so it must get into Beta 3...

@Sama34

This comment has been minimized.

Show comment
Hide comment
@Sama34

Sama34 Jul 19, 2014

Contributor

There was some weird behavior with this. I fixed it now.

This may be considered finished, if you find a bug please review the guidelines for contributing to this repository.

Contributor

Sama34 commented Jul 19, 2014

There was some weird behavior with this. I fixed it now.

This may be considered finished, if you find a bug please review the guidelines for contributing to this repository.

@Sama34 Sama34 closed this Jul 19, 2014

@Sama34 Sama34 added the fixed label Jul 19, 2014

@Sama34

This comment has been minimized.

Show comment
Hide comment
@Sama34

Sama34 Jul 19, 2014

Contributor

Just to make it clear, the following code will affect all template sets (1.6 and should work with 1.8 without issues):

find_replace_templatesets("header", "#".preg_quote('{$pm_notice}')."#i", '{$pm_notice}{$testing}');

Now you can target spesific template sets:

//.. Last argument represents the template set SID.
$sid = 2;
find_replace_templatesets("header", "#".preg_quote('{$pm_notice}')."#i", '{$pm_notice}{$testing}', 1, $sid);

Should be useful when hooking at admin_style_themes_import_commit or any other part of the script that adds template sets.

Contributor

Sama34 commented Jul 19, 2014

Just to make it clear, the following code will affect all template sets (1.6 and should work with 1.8 without issues):

find_replace_templatesets("header", "#".preg_quote('{$pm_notice}')."#i", '{$pm_notice}{$testing}');

Now you can target spesific template sets:

//.. Last argument represents the template set SID.
$sid = 2;
find_replace_templatesets("header", "#".preg_quote('{$pm_notice}')."#i", '{$pm_notice}{$testing}', 1, $sid);

Should be useful when hooking at admin_style_themes_import_commit or any other part of the script that adds template sets.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment