Skip to content
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
Closed

find_replace_templates() should accept a template SID #889

Sama34 opened this issue Jul 6, 2014 · 5 comments
Assignees
Milestone

Comments

@Sama34
Copy link
Contributor

@Sama34 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
Copy link
Contributor

@ATofighi 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
Copy link
Contributor Author

@Sama34 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.

@DiogoParrinha
Copy link
Contributor

@DiogoParrinha DiogoParrinha 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
Copy link
Contributor Author

@Sama34 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
Copy link
Contributor Author

@Sama34 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
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.